Question

Rails 4. Hi I d'like to add an lightbox to my application. I have follow the step-by-step instructions for Lightbox but my photo gallery doesn't respond at all

I have called (:all : application) the file necessary in my application.html.erb. My view is ok I think the problem reside in my way to call the vendor files.

I place all the lightbox files under vendor/assets/javascript and vendor/assets/stylesheets respectively. I did create an vendor/assets/images for the Lightbox images file (close icon...) and my application.html.erb contains:

stylesheet_link_tag    "application",  media: "all", "data-turbolinks-track" => true
javascript_include_tag "application", "data-turbolinks-track" => true 

Nothing show up properly concerning my photo-gallery. any help?

Was it helpful?

Solution

in your /assets/javascripts/application.js add this line after //= require jquery:

//= require lightbox-2.6.min

same thing for your /assets/stylesheets/application.js add this line :

//= require lightbox

OTHER TIPS

I added the following line that @medBo told me too.

But for the IMG folder I placed it inside the public folder.

add '.scss' to the lightbox.css file and edit line 195 to 'background: url(/img/close.png) top right no-repeat;' then you can keep the img folder inside the assets folder where it belongs if you are going to compile assets localy

Probably you can take a look at these gems:

Lightbox Rails

Lightbox for Bootstrap 3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top