title: How To Move a Paperclip Attachment Keeping Path Settings In Mind?
body: <p>I have two models. One being Image which has an attachment called "file" and saves to "/photos". These would be simple images that would be inside of, say, an album. I also have users that have an attachment called "avatar" which saves to "avatars/etc etc". How can I copy one attachment (@image.file) over to my user to save it as his avatar? I want the user to be able to select an image that he/she has in their album images and use it as an avatar. I want to copy it though so if the user ever deletes that image from their album, it won't delete their avatar.</p>
  
  <h2>User Model Snippet:</h2>
  
  <p><code>has_attached_file :avatar, :styles =&gt; {
        :huge =&gt; '220x220!',
        :full =&gt; '72x72!',
        :medium =&gt; '48x48!',
        :small =&gt; '24x24!'
      },
      :path =&gt; ':rails_root/public/avatars/:userid_prefix/:userid/:style-:random.:extension',
      :url =&gt; '/avatars/:userid_prefix/:userid/:style-:random.:extension',
      :default_url =&gt; :default_avatar_url</code></p>
  
  <h2>Image Model Snippet</h2>
  
  <p><code>has_attached_file :file,
      :styles =&gt; {
        :large =&gt; '640x480',
        :avatar =&gt; '72x72!',
        :cover =&gt; '160x160!'},
      :path =&gt; ':rails_root/public/photos/:userid_prefix/:userid/:id_:style-:random.:extension',
      :url =&gt; '/photos/:userid_prefix/:userid/:id_:style-:random.:extension'</code></p>