before_filter :only => :destroy do |controller|
controller.is_object_on_same_account_as_current_account_for_id?(controller_name.classify.constantize, params[:id])
end
生成错误:
NameError: undefined local variable or method `params'
app/controller/controller:4
我认为params在整个请求过程中始终可用... = \
答案 0 :(得分:2)
尝试controller.params[:id]
,因为为控制器定义了params
。
答案 1 :(得分:1)
尝试request.params [:id]或controller.request.params [:id]