title: Specifying default url for missing images in Paperclip
body: <p>Using Rails 3.2 and Paperclip 3.4.2. I have the following:</p>
  
  <pre><code># photo.rb
    has_attached_file :data,
      :styles =&gt; {
        :picture_lightbox =&gt; ["600x450&gt;", :jpg], 
        :picture_preview =&gt; ["250x250^", :jpg], 
        :picture_thumb =&gt; ["76x76^", :jpg]
      },
      :default_url =&gt; "placeholder_:style.png"
  
  # shop.rb
  has_many :photos
  
  # show.html.erb
  &lt;% if !shop.photos.blank? %&gt;
    &lt;%= image_tag(shop.photos[0].data.url(:picture_thumb)) %&gt;
  &lt;% else %&gt;
    &lt;%= image_tag('placeholder_picture_thumb.png') %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>While this works, but it defeats the purpose of specifying <code>:default_url</code> in <code>photo.rb</code>, because I don't know a way to show the default image when <code>shop.photos</code> (which is an array of photo objects) is blank.</p>
  
  <p>This is not about asset pipeline. It's about how can I detect that <code>shop.photos</code> is blank, then it returns the default image url, instead of explicitly specifying the default image url. What should I change?</p>