Skip to content

Instantly share code, notes, and snippets.

@tibra
Created February 3, 2011 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tibra/809444 to your computer and use it in GitHub Desktop.
Save tibra/809444 to your computer and use it in GitHub Desktop.
Here we get :parent_type --> works √
Paperclip.interpolates :parent_type do |attachment, style|
attachment.instance.uploadable_type.downcase
end
Here, :parent_type works in :path => but not in Proc, how do I solve this?
has_attached_file :attachment,
:path => ":class/:parent_type/:id/:style.:extension",
:styles => Proc.new { |a| a.instance.set_style(:parent_type) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment