ruby-on-railsrefinerycmsrefinery

How do you loop through a field on a custom engine in refinery cms


I'm creating a custom engine in refinery cms and I have a field called "PDF" that is a refinery resource field type.

Some entries in the engine will only have one pdf, while others will have multiple pdf's. Is there a way to do this without creating a bunch of extra fields that I don't need?

I'd prefer to loop through one pdf field rather than code extra fields into my engine - pdf_1:resource, pdf_2:resource, pdf_3:resource, pdf_4:resource, pdf_5:resource, etc.

How would you do this?


Solution

  • To the best of my knowledge there isn't a built-in Refinery process for this. has_many would be the way I would approach the problem.