Jonathan
2011-Feb-23 09:03 UTC
Dynamically setting Paperclip processors with attachment instance data
I''m trying to dynamically set my Paperclip processors which are stored
in my database, ideally I would want to access
attachment.instance.paperclip_processor, but I can''t seem to do that.
Any ideas?
# class Post < ActiveRecord::Base
has_attached_file :image,
:path => ":rails_root/
public/:hash_path/:style/:basename.:extension",
:processors => lambda { |attachment|
attachment.instance.paperclip_processor }
:styles => {
:thumb => ["175x175#", :jpg],
:resized => ["800x800>", :jpg],
}
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Apparently Analagous Threads
- Using Paperclip::Processor and RMagick to sharpen my thumbnails
- Testing file attachment with Paperclip
- Paperclip: processor proc not firing
- Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch
- Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch Going Nuts!
