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
That's all.
TSr
source share