Forum: Ruby on Rails indexed date_select

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9dbe5b9021bf8477a3b7e747b44bde48?d=identicon&s=25 Sean O'Hara (Guest)
on 2006-02-18 21:37
(Received via mailing list)
Hi All,

I am wondering if it is possible to have date_select fields that are
indexed for updating of multiple rows.

Here is my code:

<% @book.awards.each do |@award| %>
	<tr>
	<td><%= select("award[]", "category", [ "Fiction", "Non-Fiction",
"Poetry", "First-Boak", "Translation" ],
	{ :include_blank => false })  %></td>
	<td><%= date_select("award[]", "year", :start_year =>
2007, :end_year => 1980,
	:discard_month => true, :include_blank => false) %></td>
	</tr>
<% end %>

This outputs:

<tr>
	<td><select id="award_9_category" name="award[9][category]"><option
value="Fiction">Fiction</option>
<option value="Non-Fiction">Non-Fiction</option>
<option value="Translation">Translation</option></select></td>
	<td><select name="award[year(1i)]">...

Does anyone know why the name of the first select field has an index
but the name of the date select field doesn't? Is there some way
around this? I tried directly passing the helper the id for the index
but that produced errors.

Thanks,
Sean
This topic is locked and can not be replied to.