I used paperclip to attach an avatar to my user, in my model:
has_attached_file :avatar, :styles => {square_tiny: '50x50#', square_small: '100x100#', square: '200x200#'}
I have a form
<%= form_for(@user_profile, :url => { :controller => :user_profiles, :action => :update_general_info, :id => @user_profile.id }, :html => { :multipart => true, :class=> "form-horizontal" }) do |f| %> <div class="control-group"> <%= f.label :avatar, :class => "control-label" %> <div class="controls"> <%= f.file_field :avatar %> </div> </div> .... <% end %>
The download works fine, but I’m coming back and my user’s EDIT, the file field says “no file selected”. And since I check the presence of this avatar, every time the user edits his data, he must upload his avatar again ...
How do I get around this?
I thought :multipart => true would help, but it is not.
zabumba
source share