pparams is ridiculously simple rails plugin that aliases params to p.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.document
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
pparams.gemspec

README.rdoc

pparams

pparams is ridiculously simple rails plugin that aliases params to p.

Instead of

user = User.find_by_email( params[:email] )

you can use

user = User.find_by_email( p[:email] )

Sounds dumb

But I often find myself with one-liners, with mutiple calls to params, that don't fit on a single line, and that bugs me.

For example, this doesn't fit indented, without pparams, in 80 columns:

user = User.new(:email => p[:email_new], :password => p[:password_new])

The ruby function p, which is like puts with inspect, isn't that useful in rails, so its no big deal to overwrite it, especially since I use clog for logging.

Copyright © 2010 Kevin Swope. See LICENSE for details.