Skip to content

kswope/pparams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages