Does anybody know why, when using ruby-debug
by calling debugger
in a method called as a before_filter
, the params
and session
hashes are not defined?
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>
Is this normal behaviour or am I doing something wrong?