Could useful set the tag of a collection when you render it, like backboneJS?
for example , given a partial:
you could render inside two different tags
<%= render @posts,:tag=>'li'%>
<%= render @posts,:tag=>'div'%>
or without any tag
i posted this, in the #6006
Feature requests without patches are better made to rails-core: http://groups.google.com/group/rubyonrails-core?pli=1
Issues are used mostly to manage bug reports and to talk about code. I'm afraid this will get lost. That said, I'm leaving it open to see if it generates any discussion. But if someone who's done this longer than me knows better...
@steveklabnik thanks so much for the informations
Rendering a collection at the moment doesn't generate a tag - you could just do:
<%= content_tag_for(tag, post) do %>
<span><%= post.author %></span>
<span><%= post.created_at %></span>
<% end %>
<%= render @posts, :tag => :li %>
As useful as it might be, I'll have to stick with my position that this is not render's responsibility. For this api to work, it would have to look like this with current rendering architecture:
render partial: "post", collection: @posts, tag: "li"
It is not possible to only give a tag option when calling only render with a collection, the same way it's not possible to give layout or formats, you have to explicitly give :partial.
I don't see a real gain on adding the :tag as an option, considering it's possible to just add this to your partial in simpler scenarios, or to use partial layouts in other more complicated scenarios.