Prettier code in views for chained values?


Mario T. Lanza wrote:

Sometimes in a view I have written wretchedly, ugly code like this:

<%= if @person and and and %>

you can try

<%= rescue nil %>

That way, if everything's fine you get the value or else you get nothing.


javier ramírez