标签: ruby-on-rails-3.2 pundit
使用pundit gem,对用户模型上给定用户的记录ID进行授权证明是一项挑战
def initialize(user, record) @user = user @record = record end def image return true if record.user_id == user.id end
生成undefined method 'user_id'错误。
undefined method 'user_id'