title: Rails 3, Paperclip - Custom Interpolations
body: <p>I've been having some troubles making custom Interpolation, gone through every example I could find on web, but no matter what I did, had no success.
  At the moment I have this: </p>
  
  <p>Model</p>
  
  <pre><code>has_attached_file :photo,
    :path =&gt; ":rails_root/public/images/:img_name-:style.:extension",
    :styles =&gt; {
      :original =&gt; '100x100',
      :thumb =&gt; '30x30'
  }
  </code></pre>
  
  <p>initializers/paperclip.rb</p>
  
  <pre><code>Paperclip.interpolates :img_name do |attachment, style|
    attachment.instance.img_name
  end
  </code></pre>
  
  <p><code>img_name</code> is field populated in form on upload with the image.
  The error I get on upload is: </p>
  
  <blockquote>
    <p>Invalid argument - (C:/Users/.../stream20110410-384-stl2lk20110230-213-1fm2bab, C:/.../photo_upload/public/images/:img_name-original.jpg)</p>
  </blockquote>