# Before\_thumbnail\_saved - attachment\_fu helper does not work

**URL:** <https://www.ruby-forum.com/t/before-thumbnail-saved-attachment-fu-helper-does-not-work/143438>\
**Category:** Rails\
**Created:** [July 18, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/before-thumbnail-saved-attachment-fu-helper-does-not-work/143438 "2008-07-18T16:58:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anildigital](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Post date:** [July 18, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/before-thumbnail-saved-attachment-fu-helper-does-not-work/143438/1 "2008-07-18T16:58:33Z")

</div>

Hi,

I have added these lines in my model, but it does not work.

before\_thumbnail\_saved do |record, thumbnail|  
thumbnail.update\_attribute(:filename,  
thumbnail.public\_filename(thumbnail.thumbnail.to\_sym))  
end

It keeps the filenames as if they were not touched.

Basically I want to store the full image path in the database table.

–  
Anil

---

<div class="post-metadata">

**Author:** ![anildigital](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Post date:** [July 24, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/before-thumbnail-saved-attachment-fu-helper-does-not-work/143438/2 "2008-07-24T20:41:12Z")

</div>

You should probably post this question to the attachment\_fu Google  
Group instead of the general Rails group:

[http://groups.google.com/group/attachment\_fu](http://groups.google.com/group/attachment_fu)

That being said, I’m seeing the same issue with Rails 2.1 and the most  
recent version of attachment\_fu, pulled from Subversion (revision  
3183). The after\_resize callback is working fine, but the  
before\_thumbnail\_saved callback doesn’t appear to be called, at all.

Nate
