Rails 3.1 installing Lightbox Jquery plugin.

Download the plugin: http://leandrovieira.com/projects/jquery/lightbox/

In /vendor/assets

create a dir called javascript
and another called stylesheets. Move the lightbox.min.js to the newly created javascripts folder. and Lightbox.css to the stylesheets folder.


Add the file paths to application.js and application.css.  Note the order of how you enter them.

ex. application.js

//= require jquery
//= require jquery_ujs
//= require lightbox/lightbox

ex application.css

*= require_self
*= require lightbox/lightbox
*= require_tree .

Be sure to do config.serve_static_assets = true in production.rb so that assets will get served out of public/assets in production.

Run rake assets:clean followed by rake assets:precompile


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: