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.

[PATCH] search_field form helper leaves the :object key in html attributes

#5730

It seems the search_field form helper does not remove the "object" key from the options.

The search_field function stringify's keys and later tries to delete it as a symbol which obviously doesnt work.

This leaves the output form field with an invalid attribute "object='#<Post:0x103711958>'".

The fix is fairly simple and a patch is attached, or should i send a pull request?

My change is committed here -

http://github.com/asanghi/rails/commit/7ce0614ee4250606f03185a39585...

Feel free to point me out to the proper process of doing this.

Reported by Aditya Sanghi · September 29th, 2010 @ 12:51 PM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Aditya Sanghi
    Aditya Sanghi
    • Tag changed from formhelper, rails3.0.0 to 3.0.0, formhelper, rails3.0.0

    September 29th, 2010 @ 12:54 PM

  2. Aditya Sanghi
    Aditya Sanghi
    • Tag changed from 3.0.0, formhelper, rails3.0.0 to 3.0.0, formhelper

    September 29th, 2010 @ 12:55 PM

  3. Aditya Sanghi
    Aditya Sanghi
    • Assigned user set to José Valim
    • Tag changed from 3.0.0, formhelper to 3.0.0, actionview, formhelper

    This time i read the contributor's guide and now i'm providing the patch as well.

    September 29th, 2010 @ 01:52 PM

  4. Aditya Sanghi
    Aditya Sanghi
    • Title changed from search_field form helper leaves leaves the :object key in options invalidating the form to [PATCH] search_field form helper leaves leaves the :object key in options invalidating the form

    September 29th, 2010 @ 01:53 PM

  5. Aditya Sanghi
    Aditya Sanghi
    • Tag changed from 3.0.0, actionview, formhelper to 3.x, actionview, formhelper

    September 29th, 2010 @ 07:25 PM

  6. Aditya Sanghi
    Aditya Sanghi
    • Title changed from [PATCH] search_field form helper leaves leaves the :object key in options invalidating the form to [PATCH] search_field form helper leaves the :object key in html attributes

    October 1st, 2010 @ 07:07 AM

  7. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to incomplete
    • Importance changed from to Low

    You need to add a test so that the code is not removed later on.

    October 2nd, 2010 @ 11:07 AM

  8. Aditya Sanghi
    Aditya Sanghi

    Alrighty then .. here's another patch with a test included as well. Was real tricky to get the test in place since the problem only surface when used in the form_for context. Not sure if the test is in the right location right now but that's the best i could think of.

    October 2nd, 2010 @ 01:21 PM

  9. Aditya Sanghi
    Aditya Sanghi
    • Tag changed from 3.x, actionview, formhelper to 3.x, actionview, formhelper, state:new

    October 2nd, 2010 @ 01:24 PM

  10. Aditya Sanghi
    Aditya Sanghi
    • Tag changed from 3.x, actionview, formhelper, state:new to 3.x, actionview, formhelper

    October 2nd, 2010 @ 01:25 PM

  11. Repository
  12. Repository
  13. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 14th, 2010 @ 05:29 AM