Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

index does not work on fields_for select

#518
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

Reported by Kevin Glowacz · June 30th, 2008 @ 08:41 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. RSL
    RSL

    Merged Kevin's patch and my old patch for what I feel like is a better patch. Any love?

    July 12th, 2008 @ 11:03 PM

  2. RSL
    RSL

    Updated to right format. My bad :(

    July 13th, 2008 @ 12:38 AM

  3. RSL
  4. Repository
    Repository
    • State changed from new to resolved

    (from [95812d5eafc3b63ce5eeb0748a5d0132f5108b64]) Ensure :index works with fields_for select methods. [#518 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 14th, 2008 @ 01:44 AM

  5. Tom Stuart
    Tom Stuart

    Can we have the same treatment for date_helper.rb, please?

    July 14th, 2008 @ 08:02 AM

  6. Dewey Bushaw
  7. Dewey Bushaw
    Dewey Bushaw

    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.

    August 26th, 2008 @ 12:41 AM

  8. Tom Stuart