I have a User model which has_one Post model, which belongs_to User. Through a before_save callback, I want to create an (actually multiple, but this is another question) empty (or better, default like saying "This is my first post") Post, whenever a new user signs up. But the function below:
def create_post
@post = Post.new(params[:post])
@post.user = self
@post.save
gives an error:
undefined local variable or method `params' for #
What might the problem be?