Rails, Paperclip, Custom Interpolation

To allow custom interpolations in the PaperClip :path designation, add the following to your config/initializers/paperclip.rb file:

Paperclip.interpolates :custom_field do |attachment, style|
  attachment.instance.custom_field
end

 
Where :custom_field is whatever field associated with your attachment model you’d like interpolated in your path.

ABOUT THE AUTHOR

Anthony Leon

Author has no description.

NO COMMENTS

Leave a comment

Your email is never published or shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>