I am banging my head to figure out a way to have a heterogeneous collection of partials. I use this to list the collection of partials called @feed_items (in the "Tweet" class) and its working great for the one class:
<%= render :partial => 'shared/feed_item', :collection => @feed_items %>
@feed_promos partials have objects of a different class ("promotion" class) and they are in the same 'shared' directory as feed_item partial. Does anyone know the code to have both @feed_promo and @feed_item in the collection?
I have tried to simplify using the rails 3 shortcut this:
<%= render [feed_items, feed_promos] %>
But I get an error because it expects to find a template for the Tweet model but its not there and I want a collection of partials, not the objects of the different classes (like Tweets). I have already gone into the relationship.rb and tweet.rb and have included:
def to_partial_path 'shared/'