ruby - Is there a Rails equivalent to PHP's isset()? -


basically check make sure url param set. how i'd in php:

if(isset($_post['foo']) && isset($_post['bar'])){} 

is rough/best equivalent isset() in ror?

if(!params['foo'].nil? && !params['bar'].nil?) end 

the closer match #present?

# returns true if not nil , not blank params['foo'].present? 

there few other methods

# returns true if nil params['foo'].nil?  # returns true if nil or empty params['foo'].blank? 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -