# Paperclip not working on update action (rails 2.1)

**URL:** <https://www.ruby-forum.com/t/paperclip-not-working-on-update-action-rails-2-1/147935>\
**Category:** Rails\
**Created:** [September 7, 2008, 8:14am UTC](https://www.ruby-forum.com/t/paperclip-not-working-on-update-action-rails-2-1/147935 "2008-09-07T08:14:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [September 7, 2008, 8:14am UTC](https://www.ruby-forum.com/t/paperclip-not-working-on-update-action-rails-2-1/147935/1 "2008-09-07T08:14:35Z")

</div>

Paperclip is nice but its not working on the update action.

Well, to be exact, I can attach new picture records via a scaffolded  
controller and edit them, but the edit controller loses them when the  
record is updated?

Is this a known issue?

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [September 28, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/paperclip-not-working-on-update-action-rails-2-1/147935/2 "2008-09-28T22:08:47Z")

</div>

Remember to attach :html =\> { :multipart =\> true } to your form\_for  
declaration for both the new.html.erb and edit.html/erb

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [November 14, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/paperclip-not-working-on-update-action-rails-2-1/147935/3 "2008-11-14T16:43:46Z")

</div>

I am having the exact same issue as well.

At first I thought it was something with my Amazon S3 setup, so I  
removed all the S3 stuff and tried it with the file system settings  
and I’m having the same result. No errors are thrown by paperclip but  
its just not working.

The file does appear to be getting submitted via the form:

“avatar”=\>#\<File:/var/folders/qU/qUtWQXmZFhincA4TKuqR4++++TI/-Tmp-/CGI.  
13460.11\>,

but nothing happens afterwards and I cant access it via  
model.avatar.url, etc…

btw, I’m on Rails 2.1.1

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [November 9, 2008, 1:07pm UTC](https://www.ruby-forum.com/t/paperclip-not-working-on-update-action-rails-2-1/147935/4 "2008-11-09T13:07:15Z")

</div>

I have

form\_for (@user, :html =\> {:multipart =\> true}) do |f|

and paperclip not working.

I noticed:

Parameters: {“user”=\>{“profile\_pic”=\>#\<File:/tmp/CGI.1316.5\>

It seems to be uploading to /tmp, but it doesn’t get copied over to  
RAILS\_ROOT/public/profile\_pic like I’m expecting it to.

Does anybody know what might be wrong?

BTW, I’m using Rails 2.1.0 with paperclip from the github repository.

David 🙂

---

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [November 14, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/paperclip-not-working-on-update-action-rails-2-1/147935/5 "2008-11-14T17:37:16Z")

</div>

I figured it out.

Stupid, but I forgot to add :avatar to the list of attributes. So it  
was protected from mass\_assignment.
