[Rails] how to use datepicker

Akbar akbarhome at gmail.com
Sat Apr 1 05:56:12 GMT 2006


It is very weird. Anything below this line is not rendered:
<%= date_picker_field 'product', 'date_available' %></p>

For example this is my code:
<p><label for="product_title">Title</label><br/>
<%= text_field 'product', 'title'  %></p>

<p><label for="product_date_available">Date available</label><br/>
<%= date_picker_field 'product', 'date_available' %></p>

<p><label for="product_description">Description</label><br/>
<%= text_area 'product', 'description'  %></p>

<p><label for="product_image_url">Image url</label><br/>
<%= text_field 'product', 'image_url'  %></p>

Product description and product image url do not show up. Any idea?

On 4/1/06, Akbar <akbarhome at gmail.com> wrote:
> Sorry, solve it my self. Forgot to put this in the layout view:
>   <%= stylesheet_link_tag 'scaffold', 'depot', 'admin', 'date-picker',
> :media => "all" %>
>   <%= javascript_include_tag 'date-picker' %>
>
>
> On 4/1/06, Akbar <akbarhome at gmail.com> wrote:
> > On 4/1/06, Francois Beausoleil <francois.beausoleil at gmail.com> wrote:
> > > Hi !
> > >
> > >
> > > 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 %>
> > >
> >
> > Not work. The interesting is rails does not want to render anything
> > below date_picker_field line. When I click Choose Date, it just go to
> > the current page add with # in the end. You mean product is product
> > table and sale_starts_on is a column of the product table with type
> > date, right????
> >
>


More information about the Rails mailing list