有谁知道为什么,当ruby-debug
通过调用debugger
称为 a 的方法使用时,未定义before_filter
theparams
和hashes?session
class MyExampleController < ActionController::Base
before_filter :test_hashes
def test_hashes
pp session
pp params #both work as expected..
debugger #calling the debug console
end
def index
#whatever..
end
end
#the rdb console
(rdb:5) pp params
NameError Exception: undefined local variable or method 'params' for #<ActionController::Filters::BeforeFilter:0x3eafda0>
(rdb:5) pp session
NameError Exception: undefined local variable or method 'session' for #<ActionController::Filters::BeforeFilter:0x3eafda0>
这是正常行为还是我做错了什么?