Wow, thanks for pointing me to that helper. I just can''t seem to get
it to slide. Do I need a method in the controller to respond to the
movement?
Thank You,
jeff
Here is my rhtml:
<%= slider_stylesheet %>
<%= slider_field :mate, :generosity, :range => 1..10 %>
Here is the code it produces:
<style> div.slider {
width: 150px;
height: 5px;
margin-top:5px;
margin-bottom:5px;
background: #ddd;
position: relative;
}
div.slider div {
position:absolute;
width:8px;
height:15px;
margin-top:-5px;
background: #999;
border:1px outset white;
cursor:move;
}
</style>
<input id="mate_generosity" name="mate[generosity]"
type="hidden"
/><div class="slider"
id="mate_generosity_slider"><div></div></div><script
type="text/javascript">
//<![CDATA[
Element.cleanWhitespace(''mate_generosity_slider'');new
Control.Slider($(''mate_generosity_slider'').firstChild,''mate_generosity_slider'',
{onChange:function(value){$(''mate_generosity'').value = value},
range:$R(1,10), slider_value:})
//]]>
</script>
On 3/13/06, Roberto Saccon <rsaccon@gmail.com>
wrote:> I would approach this with a hidden field in your form and if you wana have
> it very easy, then use the helper from rails svn repository
>
> http://dev.rubyonrails.org/browser/plugins/scriptaculous_slider
>
>
> On 3/13/06, Jeff Blasius <jeff.blasius@gmail.com> wrote:
> >
> Hello,
> Is anyone using slider.js from script.aculo.us? I don''t understand
how
> to integrate it into a form in rails. I want to do something like
> adjust (slide) age from 16-100.
> Thank You,
> jeff
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
> --
> Roberto Saccon - http://rsaccon.com