before_thumbnail_saved - attachment_fu helper does not work

View: New views
2 Messages — Rating Filter:   Alert me  

before_thumbnail_saved - attachment_fu helper does not work

by Anil Wadghule :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: before_thumbnail_saved - attachment_fu helper does not work

by Nathaniel Bibler-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

On Jul 18, 10:58 am, "Anil Wadghule" <anildigi...@...> wrote:

> 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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---