开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜