Project

pparams

0.0
No commit activity in last 3 years
No release in over 3 years
alias params to p in rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

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.