Wiki

Clone wiki

Scriptaculous Slider / Home

Scriptaculous Slider

This plugin is of fork of the original scriptaculous slider plugin which is not maintained anymore.

It provides helpers for the script.aculo.us slider control and works with Rails 2.x.

Installation

In your Rails app root, use the following command-line :

cd vendor/plugins/
hg clone http://bitbucket.org/Bounga/scriptaculous-slider/

or install it system-wide :

$ sudo gem install scriptaculous_slider

and require it in Rails::Initializer (environment.rb) :

config.gem 'scriptaculous_slider'

You'll need to run:

rake scriptaculous_slider_install 

to install the necessary slider.js file in your public/javascripts folder.

Example

<%= slider_stylesheet %>
<%= slider_field :object, :method, :range => 1..10 %>
<%= slider_element "my_slider", :range => 1..10, :hidden_fields => true %>
<%= slider_element "my_slider", :range => 14..25, :values => 14..25, 
                               :handles => ["my_slider_min", "my_slider_max"], :increment => 10,
                               :sliderValue => [14, 25], :restricted => true, :hidden_fields => true,
                               :onSlide => "function(value) { updateSliderValues(value, 'my_slider') }" %>

slider_element doesn't create hidden field by default but can be force to create one. It can handle Range for values option.

slider_field uses a hidden field internally that gets set automatically when using the Slider.

slider_stylesheet builds a stylesheet for the slider (examine the output and copy/paste to your own CSS files).

To see the full functionality and possibilities of the slider control, have a look at the functional and unit tests provided in the script.aculo.us GIT repository, see http://github.com/madrobby/scriptaculous/tree/master.

For discussion of this plugin use the Prototype / Scriptaculous Google group!

Other

If you want to contribute you should take a look at:

Problems, comments, and suggestions are welcome on the ticket system

Copyright (c) 2008 Nicolas Cavigneaux, released under the MIT license

Updated