how to show the bigger image after clicking on thumnail ??

How to enlarge a thumnail ,when somebody click on it in ruby on rails ?? is there any gem for it?

please help .

If I’m not wrong… this may help

http://fancybox.net/

or maybe I missunderstood your question

Javier Q.

Perhaps. Actually i have number of thumnails on a page and i want when someone click on any thumnail it should show its bigger image without effecting the other thumnails and vice versa. In a simple html file ,its easy to do but in ruby on rails i don't know how to perform it.

I think you can call a link_to method to point to this image in a large size! If you are using paperclip you can call link_to “image_foo“, path_to_original_size“ .

Thanks

thanks for the reply.i hope it will help but i am not a rails expert so don't know how to implement it please can you provide a example or link for that? I will be grateful to you.

Your question is not rails related since that is done via javascript. Here are some libs for jquery:

http://jacklmoore.com/colorbox/

http://lokeshdhakar.com/projects/lightbox2/

Your question is not rails related since that is done via javascript. Here are some libs for jquery:

But i want to do it in rails.

Colorbox - a jQuery lightbox

Lightbox2

jquery will work in rails's environment?

YES! :smiley:

That’s why I mentioned fancybox… it’s a javascript way to enlarge images

Javier Q

watch this

http://railscasts.com/episodes/279-understanding-the-asset-pipeline

I think you are a bit confused.

Then try to make the right question and i’ll try to help

ok .thank you i will try it.

jquery will work in rails’s environment?

I bit of explanation. Rails handle the server side code, javascript is run on the client side. If you want content in your html to change like a resizing of an imagem the best way to do it is via manipulating it via javascript, rails can be paired with any javascript library.

In addition to the input from others I just wanted to point out that Rails just generates html and javascript to put on the page. If you know how to do it in html and you are not sure how to do it the Rails way, then just code the view to generate that html. Remember that you can always use View > Page Source (or something similar) in the browser to look at the html that your view file is generating.

Colin