Is params a ruby method?
Stepping into line 15
14 debugger
=> 15 if params[‘localData’]
in the debugger results in this message:
[-4, 5] in (eval)
*** No sourcefile available for (eval)
(eval):1
Why?
Is params a ruby method?
Stepping into line 15
14 debugger
=> 15 if params[‘localData’]
in the debugger results in this message:
[-4, 5] in (eval)
*** No sourcefile available for (eval)
(eval):1
Why?
Fritz T. wrote in post #962388:
Is params a ruby method?
It couldn’t be anything else, could it?
Stepping into line 15
14 debugger
=> 15 if params[‘localData’]in the debugger results in this message:
[-4, 5] in (eval)
*** No sourcefile available for (eval)
(eval):1Why?
Perhaps the code is dynamically generated somehow.
Why do you want to debug params anyway? It’s just a
HashWithIndifferentAccess.
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
On Nov 18, 2010, at 1:43 PM, Fritz T. wrote:
*** No sourcefile available for (eval)
(eval):1Why?
Why do you want to step INTO line 15? Did you just want to step TO the
line?
Learn more about params from:
http://apidock.com/rails
params (ActionController::Request) - APIdock (alias for
parameters)
parameters (ActionController::Request) - APIdock
http://guides.rubyonrails.org/action_controller_overview.html#parameters
-Rob
Rob B.
[email protected] http://AgileConsultingLLC.com/
[email protected] http://GaslightSoftware.com/
Rob B. wrote in post #962396:
params (ActionController::Request) - APIdock (alias for
parameters)
Interestingly, parameters is undefined in ActionController.
Marnen Laibow-Koser wrote in post #962392:
Perhaps the code is dynamically generated somehow.
That might be the explanation.
In vendor/rails/actionpack/lib/action_controller/request.rb is defined:
def parameters
@parameters ||=
request_parameters.merge(query_parameters).update(path_parameters).with_indifferent_access
end
alias_method :params, :parameters
Why do you want to debug params anyway?
Why not? Simply to explore, what’s going on inside rails.
In this special case: I think about overwriting params to implement
transparent page local memory w/o producing non-bookmarkable links.
Rob B.:
Did you just want to step TO the line?
I tried to step into using the s command. The line gets executed in two
s-steps. The first is evaluating the condition params[‘localData’], the
second is the if operator.
I’m about to dig through the rails sources.
General question: is it somhow possible, to query the source text of
generated methods?
Does anybody kow a more convenient debugger than rdebug, which gets run
by script/debugger?
Rob B. wrote in post #962411:
Try in ActionController::AbstractRequest
Where to find AbstractRequest in the sources? Using grep -R I can’t find
it.
On Nov 18, 2010, at 3:14 PM, Fritz T. wrote:
Rob B. wrote in post #962396:
params (ActionController::Request) - APIdock (alias for
parameters)Interestingly, parameters is undefined in ActionController.
Try in ActionController::AbstractRequest
Rob B.
[email protected] http://AgileConsultingLLC.com/
[email protected] http://GaslightSoftware.com/
On Nov 18, 2010, at 3:43 PM, Fritz T. wrote:
Rob B. wrote in post #962411:
Try in ActionController::AbstractRequest
Where to find AbstractRequest in the sources? Using grep -R I can’t
find
it.
Actually, it seems that this comes from Rack::Request
gems/rack-1.2.1/lib/rack/request.rb
Beyond that, you’d have to get specific about what version of Rails
you’re asking about because this is one of the bits of functionality
that has been refactored to different places more than once.
-Rob
Rob B.
[email protected] http://AgileConsultingLLC.com/
[email protected] http://GaslightSoftware.com/
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs