2011-07-14 74 views
1
before_filter :only => :destroy do |controller| 
     controller.is_object_on_same_account_as_current_account_for_id?(controller_name.classify.constantize, params[:id]) 
    end 

生成錯誤:Ruby on Rails 2.3.8:params在before_filter中是未定義的?

NameError: undefined local variable or method `params' 
app/controller/controller:4 

我認爲PARAMS總是可用的整個請求過程... = \

回答

2

嘗試因爲paramscontroller.params[:id]被用於控制器定義。

1

嘗試request.params [:ID]或controller.request.params [:ID]這種變化在3.2.9工作對我來說

+1

- 現在要弄清楚如何修改它... – MBHNYC

相關問題