Using Rails 2, I try to separate different, dynamic image sizes trough another Model from the Paperclip-Model. My current approach, using a Proc, looks the following:
<I'm assuming you have everything working with paperclip, such that you have uploaded an image and now the proc is just not working.
It should work. Try not putting the size in an array.
You are doing this
sizes = { :thumb => ["100x100"] }
But I have it where I'm not putting the size in an arry
sizes = { :thumb => "100x100" }
Give that a try :)
The solution is simple. instance
in my first example Proc is an instance of Paperclip::Attachment. As I want to call a File
method, one has to get the calling instance inside the Proc:
Proc.new { |clip| clip.instance.attachment_sizes }
instance
represents File
-instance in the given example.