This project is archived and is in readonly mode.
index does not work on fields_for select
Reported by Kevin Glowacz | June 30th, 2008 @ 08:41 PM | in 2.x
fields_for :post, @post, :index => 1 do |f|
f.select(:category, %w( abe <mus> hest))
end
currently does not add the index to the id and name.
This patch fixes and tests for it (including the other select methods)
It also adds tests to prove that f.select works with auto_index
Comments and changes to this ticket
-
RSL July 12th, 2008 @ 11:03 PM
Merged Kevin's patch and my old patch for what I feel like is a better patch. Any love?
-
Repository July 14th, 2008 @ 01:44 AM
- State changed from new to resolved
(from [95812d5eafc3b63ce5eeb0748a5d0132f5108b64]) Ensure :index works with fields_for select methods. [#518 state:resolved]
Signed-off-by: Pratik Naik
-
Dewey Bushaw August 26th, 2008 @ 12:41 AM
- no changes were found...
-
Dewey Bushaw August 26th, 2008 @ 12:41 AM
Is this the same issue as stated here (http://dev.rubyonrails.org/ticke...?
Seems to me that date_helper.rb needs to be updated as Tom Stuart pointed out.
Patch on Rails Trac works (I did not run the test) but basically it changes the following:
elsif @auto_index to elsif defined?(@auto_index)
Attached patch.diff which includes test updates but this was for rails v.2.0.1. This must have gotten lost during the switch to Lighthouse.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 551 Add proper :index support to form helpers #518 and #145
- 554 Fix fields_for with :index missing index on form option helpers This is a duplicate of #518
- 145 collection_select doesn't honour :index option to fields_for Fixed in #518