ruby on rails - dealing with variables not being set or not existing -


i wondering if there better way check if variable exists, this

if !params['attribute']['institution'].blank? 

but if attribute doesn't exist error thrown.

i saw .try() couldn't see how work in situation.

also can recommend ruby book or ruby web resource ?

thanks

alex

you can use present? or presence described blog post ola bini.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -