I think attachment_fu may have some problem working with Rails 2.0 and
above.
I use a piece of code from the book Practical Rails Social Networking
Sites by Alan Bradbune in one of my projects which uses the plugin. It
works perfectly with Rails 1.2.6 (and any other version a.2.*) but fails
to work with Rails 2.0.2 and 2.1.2. It just complains "NoMethodError
(undefined method `callbacks_for' for #<Photo:0xb4a9a484>)"
photo matt wrote:
> before_thumbnail_saved now does only take one parameter.
>
> But, the docs for after_resize still show that it is supposed to be able
> to take two parameters. Does the following very basic after_resize
> callback print good results for anybody? Below is one that will just
> output some information to the log file.
>
> after_resize do |record,img|
> logger.debug "img = #{img}"
> logger.debug "record = #{record}"
> logger.debug "self = #{self}"
> logger.debug "record.thumbnail = #{record.thumbnail}"
> end
>
>
> unknown wrote:
>> I just had this same problem with my app, in your
>> before_thumbnail_saved method you no longer pass recrd and thumbnail,
>> only thumbnail. Heres how mine looks now.
>>
>> before_thumbnail_saved do |thumbnail|
>> record = thumbnail.parent
>> thumbnail.user_id = record.user_id
>> thumbnail.parent_id = record.id
>>
>>
>> regards
>>
>> On Jun 10, 5:23�pm, photo matt <[email protected]>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---