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.

Neset forms and attr_accessible

#1911

Not sure this a bug. When using nested forms and attr_accessible, then a new parameter 'model name'_attributes has to be added to attr_accessible list. At list doc should mention that.

Reported by Greg Dan · February 8th, 2009 @ 12:36 PM

State: resolved
Milestone: 2.x
Assigned to: Eloy Duran Eloy Duran
Importance: none

Activity

  1. Eloy Duran
    Eloy Duran

    It's not a bug. You should consider the addition of nested attributes as a new attribute accessor. So if you are using attr_protected/attr_accessible you need to add the nested attributes writer method as well.

    It's the consequence of using attr_protected/attr_accessible, so I'm not sure if it has to be in the docs, although it won't hurt…

    February 8th, 2009 @ 01:40 PM

  2. Dmitry Polushkin
    Dmitry Polushkin

    Didn't thought that is a normal behaviour. For me, accepts_nested_attributes_for must add an attribute accessor. +1 for documentation this feature

    February 15th, 2009 @ 09:41 PM

  3. Eloy Duran
    Eloy Duran

    Yes it is. See the documentation for ActiveRecord:Base#attributes= http://is.gd/jF81

    February 16th, 2009 @ 08:17 AM

  4. Eloy Duran
    Eloy Duran
    • Assigned user set to Eloy Duran

    I will add the documentation btw, once I'm done with some code patches.

    February 17th, 2009 @ 08:32 AM

  5. Michael Koziarski
    Michael Koziarski
    • State changed from new to resolved

    This should be taken care of via docrails.

    February 22nd, 2009 @ 02:29 AM