RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: keithnorm
What if instead of displaying "None Give" for missing fields you wanted to not render the field. That would mean something like
<dt>Twitter:</dt> <dd><%= @user.twitter %></dd>
would have to become
<% if @user.twitter %> <dt>Twitter:</dt> <dd><%= @user.twitter %></dd> <% end %>
or just
<%= @user.twitter %>
and have the presenter output the container markup, which I don't really like. Wondering if there was any cleaner way to do that? Thanks!
What if instead of displaying "None Give" for missing fields you wanted to not render the field. That would mean something like
would have to become
or just
<%= @user.twitter %>
and have the presenter output the container markup, which I don't really like. Wondering if there was any cleaner way to do that? Thanks!