Ruby on Rails 2.3.8: params is undefined in before_filter?
before_filter :only => :destroy do |controller|
controller.is_object_on_same_account_as_current_account开发者_StackOverflow社区_for_id?(controller_name.classify.constantize, params[:id])
end
generates error:
NameError: undefined local variable or method `params'
app/controller/controller:4
I thought params was always available throughout the request process... =\
Try controller.params[:id]
since params
is defined for the controller.
Try request.params[:id] or controller.request.params[:id]
精彩评论