You can implement this yourself explicitly in the partial:
<% container ||= :div %>
<%= content_tag_for container, post do %>
<!-- content
<% end %>
I use container instead of tag, as tag is also a helper method.
-Ben
On Sun, Apr 29, 2012 at 8:25 AM, angelo capilleri
<capilleri@gmail.com>wrote:
> Could useful set the tag of a collection when you render it, like
> backboneJS?
>
> for example , given a partial:
> ```erb
> <span><%=post.autor%></span>
> <span><%=post.created_at%></span>
> ```
> you could render inside two different tags
>
> ```erb
> <ul>
> <%= render @posts,:tag=>''li''%>
> </ul>
> ```
> output:
>
> ```html
> <ul>
> <li>
> <span>one</span>
> <span>Tomorrow</span>
> </li>
>
> <li>
> <span>two</span>
> <span>Today</span>
> </li>
> </ul>
> ```
> or
>
> ```erb
> <div>
> <%= render @posts,:tag=>''div''%>
> </div>
> ```
> output:
>
> ```html
> <div>
> <div>
> <span>one</span>
> <span>Tomorrow</span>
> </div>
>
> <div>
> <span>two</span>
> <span>Today</span>
> </div>
> </div>
>
> ```
> or without any tag
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.