I'm trying to clean up my code from this...
<% if defined? foo == "local-variable" %>
<% foo = foo %>
<% else %>
<% foo = nil %>
<% end %>
To use a ternary operator like so...
<% defined? foo == "local-variable" ? foo : nil %>
However the ternary does not run properly and defaults to the nil
... I'm rather new to using ternary operators (may have gotten into the habit of using them since they save lines)... is using defined?
in a ternary possible?