title: Elegant way to only show records if they exist in rails ERB
body: <p>I'm finding that I'm using a lot of repetitive code in my ERB views when displaying information about a user. Along the lines of </p>
  
  <pre><code>&lt;% if @user.name.present? %&gt;
    &lt;%= @user.name %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I'm basically doing this for everything in my view to avoid errors (e.g. older users who may not have all the new fields).</p>
  
  <p>Is there a better way to do this?</p>