lightbox2_helpers¶ ↑
This package contains helpers that allows the usage of www.huddletogether.com/projects/lightbox2/ directly on your rails projects.
Version of lightbox2 used: v2.04
Test application can be found in github.com/splendeo/lightbox2_helpers_test
Usage¶ ↑
Copy these two lines inside the head section of your layout file / view
<%= javascript_include_tag :defaults %> <%= lightbox2_helpers_includes %>
You can use link_to_lightbox2 from then on.
Easy example:
<% link_to_lightbox2 "See picture", @picture, :group => picture.gallery_id, :title => picture.title %>
Example with a block
<% link_to_lightbox2 @picture.path, :group => gallery.name, :title => picture.caption do %>
<%=image_tag @picture.thumbnail_path %>
<% end %>
Installation¶ ↑
As a gem¶ ↑
Copy this on config/environment.erb, inside the gems section
config.gem "splendeo-lightbox2_helpers", :lib => 'lightbox2_helpers', :source => "http://gems.github.com"
Then execute
rake gems:install
The first time you initialize your server after this (presumably with script/server) the necesary javascript files and css will be copied to the public/ directory.
As a plug-in¶ ↑
I actually haven’t tried this, sorry I don’t know how to do it.
Re-installation¶ ↑
As a gem¶ ↑
Several steps are needed:
-
It is recommended that you uninstall the gem before installing a new version.
-
You must remove this file: public/javascripts/lightbox2_helpers/lightbox.js
-
And then install the new version
Commands for this:
sudo gem uninstall splendeo-lightbox2_helpers rm public/javascripts/lightbox2_helpers/lightbox.js rake gems:install
As a plug-in¶ ↑
I haven’t got that part figured out yet.