title: rails actionview: How to "not show" attributes if receiving nil or something else
body: <p>Is there an easy way to remove options attributes for the <code>tag</code> or <code>content_tag</code> helper?</p>
  
  <pre><code>&lt;%= content_tag :div, content, {
    class: 'content',
    style: styles_hash.map{|x| "#{x[0].underscore.dasherize}: #{x[1]}"}.join('; '),
    data: {
      hyperlink: (hyperlink if hyperlink.present?)
    }
  } %&gt;
  </code></pre>
  
  <p>In this example, I'm wondering how to remove the <code>data-hyperlink</code>. Even if I throw a <code>nil</code> or <code>false</code> it stills displays as either <code>data-hyperlink="null"</code> or <code>data-hyperlink="false"</code> respectively. I need it to not display entirely if not present.</p>