为什么我会收到此错误?我没有想法.
undefined method `update_attributes' for #
码:
exists = Vote.where(comment_id: @comment.id).exists?
if exists
update_vote = Vote.where(comment_id: @comment.id)
update_vote.update_attributes(value: 5)
redirect_to :back
else
Run Code Online (Sandbox Code Playgroud)