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
Post a Comment