I have three models: paste
, snippet
and tutorial
. I want to show the newest of all of them mixed in one list, like this on the page:
<ul>
<li>Just a paste</li>
<li>The worst snippet ever (-10202343 kudos) (1 quadrillion comments)</li>
<li>Just another paste</li>
<li>Ruby on Rails tutorial (5 kudos) (2 comments)</li>
<li>Another snippet</li>
</ul>
Ordered by date. The problem is that I want to mix these three models in one list. All models have specific attributes (e.g. snippet
and tutorial
have tags, all have titles, tutorial
s and snippet
s have have kudos, only paste
has a private boolean (so it should not be listed)).
How can I do some kind of mixing these different models in my view? Thanks