title: How to check if variable is empty in rails view?
body: <p>I am using paperclip in my rails app.  I want to use an image uploaded via paperclip if an attribute appears for the field and use another image if it doesn't.  With this code, the first portion of the if statement always executes regardless of whether there is an entry in the logo field.  Any advice?</p>
  
  <pre><code>        &lt;% if @product.logo.url %&gt;
              &lt;%= image_tag @product.logo.url, :style =&gt; 'width:60px;' %&gt;
          &lt;% else %&gt;
              &lt;img src = '/assets/logo/&lt;%= @product.slug.downcase %&gt;-sq.jpg' class="img-circle" style = 'width:60px;'&gt;
          &lt;% end %&gt;
  </code></pre>