before_filter
이라는 메서드에서 debugger
을 호출하여 ruby-debug
를 사용할 때 params
및 session
해시가 정의되지 않은 이유는 누구나 알 수 있습니까?before_filter에서 정의되지 않은 params와 세션 해시
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>
이 정상적인 동작입니까 또는 내가 잘못하고 있습니까?
A b.s. 선..? 나는 이해가되지 않을까 두렵다. – andi
1과 같은 숫자 리터럴. b.s. 말도 안돼. – jshen
나는 그 학사를 말하는 줄 알았지 만, 어떻게하면 좋은 일을 할 수 있는지 보지 못했습니다. :) 그러나 나는 그것을 시도하고 그것은 효과가! 나는 그것을 믿을 수 없다! 어떻게 왔어?! 합리적인 설명이 있습니까? 이거 버그 야? – andi