Ruby on Rails - Creating a profile when user is created
问题 So basically I have wrote my own authentication instead of using a gem so I have access to the controllers. My user creation works fine but when my users are created I want to also create a profile record for them in my profile model. I have got it mostly working I just cant seem to pass the ID from the new user into the the new profile.user_id. Here is my code for the user creation in my user model. def create @user = User.new(user_params) if @user.save @profile = Profile.create profile.user