views:

10

answers:

1

I have a user model where I cannot create a client due to it being unwritable in mass assignment.

How do I make it so that I can create a client model?

Code and error are found here: http://pastie.org/1206482

+1  A: 

I think you have to add:

attr_accessible client_attributes

to your user model. client_attributes is the hash in the user hash posted to the create action.

The transmitted hash looks something like this: :user => { :username => "one", ..., :client_attributes => { :name => "client" } }

Patrick R.
Thanks for that. I just realized it didn't have to be a column name for it to be attr_accessible.
Maletor