New Rails User stuck on tutorial => Updating Posts/Mass Assignment

Hey guys, I’ve just started with Rails. I’m going through the getting
started tutorial, and I’m running into this error:
ActiveModel::MassAssignmentSecurity::Error in PostsController#update
I know it has to do with the new update and the whitelist attributes,
but I don’t have the first idea how to fix it.

Any help would be extremely appreciated!


attr_accessible :my_attribute_name…

to your model.rb file


On Apr 2, 2012, at 5:33 , aekwolf wrote:

To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

Thank you!!


yes, I had the same problem yesterday, and I’m also going through a
tutorial - maybe the same one?

Solved with 2 steps: added attr_accessible as mentioned earlier
message. Also I had to change the RSpec tests from

@user =“Example”, email:“[email protected]”).tap do
u.password = “foobar”
u.password_confirmation = “foobar”

isnted of
@user =“Example”, email:“[email protected]”,
password = “foobar”, password_confirmation = “foobar”)

and npw MassAssignment erros has gone.

On Apr 2, 10:48pm, aekwolf [email protected] wrote:

Thank you!!