params - is it a method?

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 Trapper 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):1

Why?

Perhaps the code is dynamically generated somehow.

Why do you want to debug params anyway? It's just a HashWithIndifferentAccess.

Best,

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 Biedenharn Rob@AgileConsultingLLC.com http://AgileConsultingLLC.com/ rab@GaslightSoftware.com http://GaslightSoftware.com/

Marnen Laibow-Koser wrote in post #962392:

Perhaps the code is dynamically generated somehow.

That's probably the explanation.

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 Biedenharn:

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?

Rob Biedenharn wrote in post #962396:

params (ActionController::Request) - APIdock (alias for parameters)

Interestingly, parameters is undefined in ActionController.

Try in ActionController::AbstractRequest

Rob Biedenharn Rob@AgileConsultingLLC.com http://AgileConsultingLLC.com/ rab@GaslightSoftware.com http://GaslightSoftware.com/

Rob Biedenharn 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 Biedenharn Rob@AgileConsultingLLC.com http://AgileConsultingLLC.com/ rab@GaslightSoftware.com http://GaslightSoftware.com/