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.

FormHelper should allow model to be inherited from hash

#6487

Currently any model inherited from Hash and passed to fields_for helper will always be nil. This tiny patch handles FormBuilder parameters in an elegant way.

Reported by wildchild · February 28th, 2011 @ 04:40 PM

State: resolved
Milestone: 3.x
Assigned to: Andrew White Andrew White
Importance: Low

Activity

  1. Andrew White
    Andrew White
    • State changed from new to open
    • Milestone set to 3.x
    • Assigned user set to Andrew White
    • Importance changed from to Low

    It needs a require added for extract_options! from ActiveSupport and some tests, then I can push it.

    March 5th, 2011 @ 06:55 PM

  2. Diego Carrion
    Diego Carrion

    Hi, attached is the failing test. The patch from wildchild make it pass.

    March 6th, 2011 @ 03:53 AM

  3. wildchild
    wildchild

    Patch updated to require core_ext/array/extract_options.

    March 6th, 2011 @ 04:05 AM

  4. Repository
    Repository
    • State changed from open to resolved

    March 6th, 2011 @ 05:51 AM

  5. Repository
    Repository

    (from [9cee693213e0205cb5992728bb516215e34cb79f]) Merge branch 'master' of github.com:rails/rails

    • 'master' of github.com:rails/rails: (44 commits) Fixed indentation in actionmailer base_test [#6538 state:committed] remove unused assigned variable removes merge conflicts removes Examples headers introduced in 9b96de6 Revert "Fixed identation in actionmailer base_test" Report the correct value of nil.id in the exception message as different ruby implementations may have different values, for example Rubinius returns 53 for nil.id. Improve testing of cookies in functional tests: - cookies can be set using string or symbol keys - cookies are preserved across calls to get, post, etc. - cookie names and values are escaped - cookies can be cleared using @request.cookies.clear more style changes Some style changes style changes Revert "style changes" Raise ArgumentError if route name is invalid [#6517 state:resolved] style changes Allow model to be inherited from Hash [#6487 state:resolved] styles applied for usage added failing test for fields_for with a record object that inherits from Hash Fixed identation in actionmailer base_test wrong SQL statement commas to set off expressions that interrupt sentence flow typo changes ... https://github.com/rails/rails/commit/9cee693213e0205cb5992728bb516...

    March 7th, 2011 @ 04:51 PM