On 18 Mar., 14:20, elliottg <[email protected]> wrote:
> When I implement this line:
> �...@user = User.new(params[:user], :role => [ Role.new(params[:role]) ])
>
> I get this argument error.
> ArgumentError in UsersController#create
> wrong number of arguments (2 for 1)
>
> Any thoughts?
>
> Thanks
The #new method only accepts one argument. Do this instead:
@user = User.new(params[:user].merge(:role => Role.new(params
[:role])))
--
Cheers,
David Knorr
http://twitter.com/rubyguy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
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
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---