On 4 Jul 2008, at 17:13, Tarscher wrote:
>
> Hi all,
>
> I have a user that has one activation.
>
> When a user is created I want to generate an activation key
>
> I tried in the create usercontroller
> @user = User.new(params[:user])
> @user.activation << Activation.new()
>
> I get:
> You have a nil object when you didn''t expect it!
> You might have expected an instance of Array.
> The error occurred while evaluating nil.<<
>
> I want to save the user and it''s association (activation). How can
I
Assuming activation is a singular association (ie not a has many) then
you should be using = not <<
Fred
>
> do this?
>
> thanks
> Stijn
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---