Can't mass-assign protected attributes

后端 未结 4 419
一整个雨季
一整个雨季 2021-02-05 02:53

Updating the code formatting for better viewing.

Folks,

I have been looking at this for sometime but I don\'t understand what could be messing up here. I am usin

4条回答
  •  既然无缘
    2021-02-05 03:29

    Have a look here and learn :)

    http://railscasts.com/episodes/26-hackers-love-mass-assignment


    Edit:

    Having accepts_nested_attributes_forin User model enables you to send the data to the Address model.

    Then, in the Address model, you have to set the requested attr_accessible

提交回复
热议问题