I have a collection of Attachments, Notes, and Array of Attachments. For example
@heteroCollection = [Attachment, Note, Note, [Attachment, Attachment, Attachment]]
In my view I attempt to render this collection
<%= render :partial => @heteroCollection %>
but rails chokes saying the array of attachments needs to implement :to_partial_path
[Attachment, ..., Attachment] is not an ActiveModel-compatible object. It must implement :to_partial_path
If I remove the array the rendering works great calling _attachment.html.erb and _note.html.erb for the respective records.
Is there a way to implement :to_partial_path on Array without monkey patching? Or is there another better solution?