Because of some third party dependencies I’m trying to use a
date_select helper (actually datetime, but they behave the same)
whilst specifying an ID for each of the three selectors (day/month/
year).
<%= f.date_select :start, {:order => [:day, :month, :year]}, {:id =>
{:year => ‘abc’, :month => ‘de’, :day => ‘xy’}} %>
The code above nearly works; the right selectors are generated in the
right order, however, the IDs of each selector are the same; simply a
flattened down version ‘monthdeyearabcdayxy’, using an array has the
same effect.
How can I achieve this while still having Rails handle most of the
work?
<%= f.date_select :start, {:order => [:day, :month, :year]}, {:id =>
{:year => ‘abc’, :month => ‘de’, :day => ‘xy’}} %>
The code above nearly works; the right selectors are generated in the
right order, however, the IDs of each selector are the same; simply a
flattened down version ‘monthdeyearabcdayxy’, using an array has the
same effect.
How can I achieve this while still having Rails handle most of the
work?
Your best bet is probably to call the individual helpers for each
component (select_hour etc…). Look at the output of date_select to
see what names you should use for the inputs.
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.