title: Carrierwave Temporary File Without Model
body: <p>I need to be able to attach a file to a mail (using Mailer) for a recently uploaded file which is not linked to any Model.</p>
  
  <p>In the code that goes for the upload form:</p>
  
  <pre><code>&lt;%= form_for(:mail, :url =&gt; {:action =&gt; 'send_mail'}, :html =&gt; {:multipart =&gt; true}) do |f| %&gt;
  &lt;table summary="send_table"&gt;
    &lt;tr&gt;
      &lt;th&gt;Attachment&lt;/th&gt;
      &lt;td&gt;&lt;%= f.file_field(:attachment) %&gt;&lt;a id="attachment"&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;%= submit_tag "Send!" %&gt;
  </code></pre>
  
  
  
  <p>Now, what I am looking into doing in the send_mail action is something like:</p>
  
  <pre><code>MyMailer.send_mail(params[:mail][:attachment]).deliver 
  </code></pre>
  
  <p>with params[:mail][:attachment] being the path to the temp file uploaded with the form. How can one do that?</p>
  
  <p>This also implies another question: Should I manually delete the file from the temp once the mail is sent? If yes, how? </p>