Guest User

Untitled

a guest
Jul 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Here we get :parent_type --> works √
  2.  
  3. Paperclip.interpolates :parent_type do |attachment, style|
  4. attachment.instance.uploadable_type.downcase
  5. end
  6.  
  7. Here, :parent_type works in :path => but not in Proc, how do I solve this?
  8.  
  9. has_attached_file :attachment,
  10. :path => ":class/:parent_type/:id/:style.:extension",
  11. :styles => Proc.new { |a| a.instance.set_style(:parent_type) }
Add Comment
Please, Sign In to add comment