Rails 3: After_save create profile
I have a user model and a profile model that are tied together.
What I'd like to do is to create an user profile every time an user registers.
Here's what I have in the User model now:
after_save :create_profile protected def create_profile @profile = current_user.build_profile(params[:profile]) @profile.save end
However, it doesn't seem to work because current_user is not recognized, which makes sense, however, what's the way to fix this?
For a has_one association: