I'm making an ActiveRecord query that joins the contents of each of my models into an array called @contents
. But I need to display the content different for data that comes from a specific model.
So in my view I need to perform some sort of test on the elements of my array:
<% @contents.each do |c| %>
<article>
<% if [TEST FOR EVENT] %>
EVENT HTML
<% elsif [TEST FOR POST] %>
POST HTML
<% end %>
</article>
<% end %>
How do I get the model that c
comes from?