Slimbox plugin for Rails
JavaScript Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
public
INSTALLED
LICENSE
README.markdown
init.rb
install.rb

README.markdown

jQuery Slimbox Rails plugin

Introduction

This plugin will add two helpers, to make it faster to use Slimbox for jQuery in Rails.

Installation

In order to use Slimbox, you must satisfy it's dependencies first. Slimbox needs it's Javascript file and the default stylesheet in order to function correctly. These are copied to places by the plugin upon installation. You just have to include them now.

Because this plugin embeds the slimbox.js into the :slimbox option to javascript_include_tag. You can simply add the :slimbox option to an existing line or by itself.

<%= javascript_include_tag :slimbox %>

You must also include the slimbox stylesheet. Add this to the page head:

<%= stylesheet_link_tag 'lib/slimbox2' %>

Usage

Use one of the two helpers provided.

<%= slimbox_link_to "Link Name", "/path/of/your/image.png" %> 

or

<%= slimbox_image_tag "/path/of/your/image-thumb.png", "/path/of/your/image.png", {:class=>"images"}, :title => "This is a test!", :group => "image_group" %>

The 4th argument are options for the image_tag and the last argument are options for the link_to.