Hi guys, i just write this method: http://gist.github.com/mrThe/5143746<p>Why?
Becouse i can write BaseController method like this:<p><pre><code> def check_params!(path, exception = "Not enough params")
raise exception unless params.deep_symbolize_keys.path_exists?(path)
end
</code></pre>
And use it like this in needed controller action:<p><pre><code> check_params!({:user => [:email]}, "No email")
</code></pre>
instead of<p><pre><code> raise "No email" unless params[:user] && params[:user][:email]
</code></pre>
What do you think about this? Is it good idea?<p>/related to Ruby On Rails, i write some RESTful api app and every time will check input params.