title: Uploadify + Paperclip + Rails nested association before_save
body: <p>I need to create a model application form where models can fill it and add pictures to it.</p>
  
  <p>I'm following this example with Uploadify, Paperclip and Rails 3 approach.
  <a href="https://github.com/websymphony/Rails3-Paperclip-Uploadify" rel="nofollow">https://github.com/websymphony/Rails3-Paperclip-Uploadify</a></p>
  
  <p>To the pictures, i have an polymorphic Attachment model and i would like to attach those ajax uploaded attachments to the yet unsaved model form and there's is where the tricky part cames. </p>
  
  <p>Users are not logged, so there's no "model_id" until is saved. </p>
  
  <p>Since i'm showing the user a small preview of the images that he uploaded in the form by ajax after each upload i need some way to correlate them.</p>
  
  <p>I was thinking about some middle token until the model is saved but i'm not sure whats the best approach to accomplish this. </p>
  
  <p>Thank you!</p>