小编use*_*279的帖子

未定义的方法`update_attributes'?

为什么我会收到此错误?我没有想法.

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)

ruby-on-rails mongodb mongoid ruby-on-rails-4

2
推荐指数
1
解决办法
3267
查看次数

标签 统计

mongodb ×1

mongoid ×1

ruby-on-rails ×1

ruby-on-rails-4 ×1