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?
<% if @product.logo.url %>
<%= image_tag @product.logo.url, :style => 'width:60px;' %>
<% else %>
<img src = '/assets/logo/<%= @product.slug.downcase %>-sq.jpg' class="img-circle" style = 'width:60px;'>
<% end %>