Forum: Ruby on Rails indexed date_select

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sean O'Hara (Guest)
on 2006-02-18 22: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| %>
	<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>
<% end %>

This outputs:

	<td><select id="award_9_category" name="award[9][category]"><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.

This topic is locked and can not be replied to.