Lightboxes for rails?

Does anyone know a good lightbox plugin for rails? I found Redbox, but it seems it is not in development.

Thanks!

-Elliot

+6
ruby-on-rails lightbox
source share
7 answers

I just use regular Lightbox 2. Include all relevant javascript and style sheets: rel => "lightbox" in your links.

+5
source share

Here is an example of how easy it is to use lightbox in rails (v4 in my case):
1. Download from the website: http://lokeshdhakar.com/projects/lightbox2/
2. Copy lightbox.js to application / assets / javascripts
3. Copy lightbox.css to application / assets / style sheets
4. Rename lightbox.css to lightbox.css.scss.erb
5. Copy 4 img to app / assets / images
6. Modify lightbox.css.scss.erb:
- All image paths are replaced by:

<%=image_path "close.png"%> 

with the correct image name.
Add the data-lightbox attribute to any image link to activate Lightbox. For the attribute value, use a unique name for each image. For example:

 <a href="img/image-1.jpg" data-lightbox="image-1" data-title="My caption">Image #1</a> 

That's all.

+3
source share

Is there something wrong with jQuery version?

Jquery on rails

http://railstips.org/2008/11/20/jquery-on-rails-why-bother

+2
source share

You can try lightbox2 , you donโ€™t know if there is any rails plugin to use it, but writing some helper functions shouldn Itโ€™s not so difficult.

0
source share
0
source share

I would recommend rlightbox . This is a jQuery UI plugin. It can be used for photos and videos, and the documentation is pretty good.

0
source share

I wrote my own Rails wrapper to use Lightbox inside an existing Rails application.

Github: https://github.com/vernondegoede/lightbox-rails

0
source share

All Articles