0
我想一些日誌時出現錯誤:麻煩記錄器
NoMethodError in RelationController#create
undefined method `attributes' for #<ActiveRecord::Relation:0x431e650>
這是我的控制器
def create
follow = User.find(params[:relation][:following_id])
current_user.following << follow
logger.debug "follow: #{follow.attributes.inspect}"
logger.debug "current_user: #{current_user.attributes.values}"
logger.debug "following: #{current_user.following.attributes.values}"
redirect_to follow
end
我能做些什麼來解決這個問題,請大家幫幫我!
它工作呼叫
attributes
!謝謝 :) – mayoneQD 2014-10-27 07:26:55