I have two different types of objects, say of classes Object1 and Object2. I want to be able to render, mix, and sort them in the same container.
In the controller action:
@objects1=Object1.reorder('created_at DESC')
@objects2=Object2.reorder('created_at DESC')
In the view:
<div class="container">
<%= render @objects1 %>
<%= render @objects2 %>
</div>
What SQL/ActiveRecord statement can I use so that they are sorted against one another?
How about just combining them into a single array and then sorting the array?