[Rails] how to use datepicker

Francois Beausoleil francois.beausoleil at gmail.com
Sat Apr 1 04:37:35 GMT 2006


Hi !

2006/3/31, Akbar <akbarhome at gmail.com>:
> This is the webpage:
> http://projects.exactlyoneturtle.com/date_picker/
>
> I have downloaded and installed it. But how do I use in view page?
>
> This is the usual view with ordinary datetime_select:
> <p><label for="product_date_available">Date available</label><br/>
> <%= datetime_select 'product', 'date_available'  %></p>
>
> So I have table named 'product' with one of the column named
> 'date_available'. How do I use date_picker rather than
> datetime_select?
>
> The author give html page not rhtml page.

You'll need to copy the helper.  This should really be packaged as a
plugin, but it's not at the moment.  Anyway, copy the helper to your
application's lib/.  Then, you can use this:

<%= label 'Sale Starts On', :product, :sale_starts_on %>
<%= date_picker_field :product, :sale_starts_on %>

Hope that helps !
--
François Beausoleil
http://blog.teksol.info/


More information about the Rails mailing list