Note that there are some explanatory texts on larger screens.

plurals
  1. POPaperclip won't save image in Rails app
    text
    copied!<p>I am trying to use <a href="http://github.com/thoughtbot/paperclip" rel="nofollow noreferrer">Paperclip</a> with my Rails app to add an avatar to a user but it won't save my image or update the database column when creating the user.</p> <p>This is what the model looks like:</p> <pre><code>class User &lt; ActiveRecord::Base has_attached_file :avatar </code></pre> <p>And the registerform in haml:</p> <pre><code>- form_for :user, @user, :url =&gt; { :action =&gt; "signup" }, :html =&gt; { :multipart =&gt; true } do |f| ... ... %li %div{:class =&gt; "header"} Profilepicture %div{:class =&gt; "input"} = f.file_field :avatar </code></pre> <p>And when I look in the log this is what is being passed to the "signup" action:</p> <pre><code>Parameters: {"commit"=&gt;"Save", "action"=&gt;"signup", "controller"=&gt;"user/register", "user"=&gt;{"name"=&gt;"Micke Lisinge", "birthmonth"=&gt;"07", "password_confirmation"=&gt;"[FILTERED]", "nickname"=&gt;"lisinge", "avatar"=&gt;#&lt;File:/tmp/RackMultipart20100426-3076-1x04oxy-0&gt;, "gen"=&gt;"m", "birthday"=&gt;"23", "password"=&gt;"[FILTERED]", "birthyear"=&gt;"1992", "email"=&gt;"lisinge@gmail.coma"}} [paperclip] Saving attachments. </code></pre> <p>Paperclip says it is saving the template but when I look in the <code>public</code> folder in my app it has created a <code>system</code> but the <code>system</code> folder is empty.</p> <p>So it seems like it isn't saving the picture to the folder.</p> <p>It gets handled by the form and saved in my <code>/tmp</code> folder.</p> <p>Maybe you guys have any tips or know what this problem might be?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload