I was wondering if there is a better way to check if a variable exists, currently I do this
if !params['attribute']['institution'].blank?
But if attribute doesn’t exist then a error is thrown.
I saw .try() but couldn’t see how it would work in this situation.
You can use
present?orpresencewhich was recently described by a blog post by Ola Bini.