Elliot
Elliot

Reputation: 13845

Lightbox for rails?

Does anyone know of a good lightbox plugin for rails? I found redbox but it seems to be out of development.

Thanks!

-Elliot

Upvotes: 6

Views: 10975

Answers (7)

Vernon
Vernon

Reputation: 443

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

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

Upvotes: 0

TSr
TSr

Reputation: 341

Here is example how to easily use lightbox in rails (v4 in my case):
1. Download from site: http://lokeshdhakar.com/projects/lightbox2/
2. Copy lightbox.js to app/assets/javascripts
3. Copy lightbox.css to app/assets/stylesheets
4. Rename lightbox.css to lightbox.css.scss.erb
5. Copy four img's to app/assets/images
6. Edit lightbox.css.scss.erb:
- All image paths replace with:

<%=image_path "close.png"%>

with proper image name.
Add a data-lightbox attribute to any image link to activate Lightbox. For the value of the attribute, 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>

Thats all.

Upvotes: 4

kcurtin
kcurtin

Reputation: 521

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

Upvotes: 0

DevDevDev
DevDevDev

Reputation: 5177

Is there anything wrong with the jQuery version?

Jquery on Rails

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

Upvotes: 2

Fernando Kosh
Fernando Kosh

Reputation: 1

You can use http://github.com/Lipsiasoft/lightbox

Upvotes: 0

Jarrod
Jarrod

Reputation: 2378

I just use the regular Lightbox 2. Include all the appropriate javascript and stylesheets then :rel => "lightbox" on your links.

Upvotes: 5

Ricardo Acras
Ricardo Acras

Reputation: 36244

You can try lightbox2, don't know if there is any rails plugin to use it, but writing some helper functions shouldn't be that difficult.

Upvotes: 0

Related Questions