Clip for rails: can I access the model?

Let's say I have a model called Theme that has several attributes that set the colors of the interface. The theme also has a Pearlclip attachment, which is a user-created CSS template. I want to configure the processor to create the final CSS file by inserting the colors of the interface into a user-created template. To do this, I need to access the model data from the processor. Is it possible?

+6
ruby-on-rails paperclip
source share
1 answer

The processor has an accessor called attachment , this indicates an instance of Paperclip :: Attachment. In turn, the application has an instance accessor that points to an instance of the source model. So all you have to do with the processor is call attachment.instance to get the original model.

+8
source share

All Articles