Skip to content

Instantly share code, notes, and snippets.

@phlipper
Created October 11, 2012 17:39
Show Gist options
  • Select an option

  • Save phlipper/3874180 to your computer and use it in GitHub Desktop.

Select an option

Save phlipper/3874180 to your computer and use it in GitHub Desktop.
Example Paperclip Interpolation
class Collateral < AR::B
has_attached_file :movie, url: "/uploads/:attachment/:id/:cache_key/:filename"
end
Paperclip.interpolates("cache_key") do |attachment, style|
attachment.instance.cache_key.parameterize
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment