I stuck with setting up the Fancybox window for my photos, I am doing it like this:
$(document).ready(function() {
$('.fancybox').fancybox();
});
This is initialization of Fancybox. Then the setup of links and images:
= link_to i.file_url, :class => 'fancybox', :rel => 'gallery', :title => i.title do
= image_tag i.file_url, :style => 'width: 150px;'
which generates this HTML code:
<a href="URL TO FILE" class="fancybox" rel="gallery" title="Item Name">
<img alt="something" src="URL TO FILE" style="width: 150px;">
</a>
But when I click on the link, the image is loaded in the new window instead of in the Fancybox window. The Fancybox JS+CSS libraries are added correctly - what am I missing yet?
Thanks