Plugins - Has Params

StarAdd to favorites

This plugin allows you to stop checking parameters via the params hash, in favor of a much cleaner alternative.

What’s the point?

Really, there is no point. And I wouldn’t be surprised if I were the only one to think this is worthy of using, but here it is anyway. Have you ever written a line of code similar to this?

  Project.new(params[:project]) unless params[:project].blank?

To me, the params[:project].blank? part stinks up that line. So, I got rid of it. With has_params, you can do this instead:

  Project.new(params[:project]) unless blank_project_params?

Much better.

Ryan Heath

http://rpheath.com/posts/326-rails-plugin-has-params

http://github.com/rpheath/has_params/tree/master

Rails' (MIT)

  • Currently 3.4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Controllers

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?