params key

Just print it out...

pp params

But a word of caution - do remove the pp line in production mode as this can
bring your app down to its knees - "something went wrong"...

In your view, you can do <%= debug(params) %> to see that what all's there

in the params hash.

:)

Maku
[http://www.apnabill.com](http://www.apnabill.com)

मयंक जैन (makuchaku) wrote:

Just print it out...

pp params

Despite you may have answered the wrong question, it bears repeating here that nothing compares to this savage technique:

   raise params.inspect

Bam - a browser full of nothing but your params. And a stack dump!

Thanks for the tips guys but I am not trying to debug so printing
doesn't help. I actually have conditional logic in my controller that
depends upon whether or not the key is in the hash. So far the first
solution seems to work.

Phlip wrote:

I do agree that it dumps everything - but at times it helps in debugging… - but yes, point taken :slight_smile:

Steve Glaz wrote:

Thanks for the tips guys but I am not trying to debug so printing doesn't help. I actually have conditional logic in my controller that depends upon whether or not the key is in the hash. So far the first solution seems to work.

Are you sure you shouldn't just use two different routes? Sometimes routes are better than extra ?key=value&... parameters!

If you're looking for one key in particular, you can always:

...do stuff... if params[:certain_key]

Check for empty values if needed.

-Kyle