views:

50

answers:

1

How can I suppress the generation of the seconds tag when using the datetime_select helper?

I tried using the option :include_seconds => false (used in the time_select helper) but It doesn't work.

+1  A: 

You can override what's shown with :order, such as:

<%= f.datetime_select :fieldname, :order => [:month, :day, :year, :hour, :minutes] %>
Bill Turner
The order option only works for `month`, `day` and `year`, but thanks to that, I figured out that you can also declare `:discard_xxx => true`, in this specific case `:discard_seconds => true` which works pretty well. Thanks.
jpemberthy
Bill Turner