I''m not sure if this is what you''re looking for, but I had a
similar
problem giving a thumbnail
the foreign key of its parent. Try this in the model that''s using
attachment_fu:
before_thumbnail_saved do |record, thumbnail|
thumbnail.foo = record.foo
end
On Apr 17, 5:38 pm, jstepper
<jstep...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have a model using attachment_fu (via has_attachment) and I''m
> creating thumbnails for the attached images. I have an extra field
> ''foo'' that I''m validating on create with
validates_presence_of :foo.
>
> One problem arises when I upload an image:
>
> The ''foo'' is not propogating down to the thumbnails.
What should I
> put in my model to grab the parent''s (via parent_id)
''foo'' if no foo
> is provided?
>
> Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---