vendredi 24 juillet 2015

in ERB Inline code to fetch first non nil array value

I need to fetch first non nil value in an array.

I tried this code but doesnt seem to be work entity['perattr.firstname'].to_s.find{|x|!x.nil?}

it is giving me below error. Please let me know how to get the value?

find' for "[]":String

Aucun commentaire:

Enregistrer un commentaire