I see that if I use the date_select helper in my view, then in the
generated page, my selects are named obj[datetime_field(1i)] (and 2i and
3i for the other parts). These auto-populate the date portion of my
datetime_field.
I have another datetime field that I’m presenting the time from and I
would like to use a similar scheme to autopopulate it. Currently, I’ve
used the :prefix option to select_hour/minute/second to get the
parameter name set correctly, but I end up with a hash with keys ‘hour’,
‘minute’ and ‘second’. I can definitely handle this, but was wondering,
can I just use 4i, 5i, 6i to index into the time portions of a datetime
field?
I see that if I use the date_select helper in my view, then in the
generated page, my selects are named obj[datetime_field(1i)] (and 2i and
3i for the other parts). These auto-populate the date portion of my
datetime_field.
I have another datetime field that I’m presenting the time from and I
would like to use a similar scheme to autopopulate it. Currently, I’ve
used the :prefix option to select_hour/minute/second to get the
parameter name set correctly, but I end up with a hash with keys ‘hour’,
‘minute’ and ‘second’. I can definitely handle this, but was wondering,
can I just use 4i, 5i, 6i to index into the time portions of a datetime
field?
Thanks,
Wes
Here’s what I ended up with after reading through the source of
date_helper.rb: