Search code examples
ruby-on-railslightbox2

Rails add a lightbox to an application


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?


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