Rails 3: NoMethodError in ReviewsController#create
I have a relationship user (has_many :reviews) and review ( belongs_to :user) and I'm getting a NoMethodError when I try to execute create in reviews_controller.
def create
@review = @user.reviews.create(:service_id => 10)
end
The same que开发者_开发技巧ry works fine in the console but it gives that error when I do it through the controller.
What am I missing here?
Thank you.
Print out @user details to log to verify current_user is populating the value correctly.
精彩评论