Don''t forget ''='' character after
''%''
<%= render_partial_collection "layouts/list", @lists %>
Kent
On 5/15/05, Steve Odom
<steve.odom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I can''t figure out why this render_collection_of_partials
won''t work.
> Hope someone can catch my mistake.
>
> This works and is what I am trying to replace:
>
> <% @lists.each do |list| %>
> <tr>
> <td><%= link_to(list.category.cat, :controller =>
"product",
> :action => "listings", :id => list.category.id)
%></td>
> </tr>
> <% end %>
>
> Here is what I am replacing that with:
> <% render_partial_collection "layouts/list", @lists %>
>
> and my partial (_list.rhtml)
> <tr>
> <td><%= link_to(list.category.cat, :controller =>
> "product", :action => "listings", :id =>
list.category.id) %></td>
> </tr>
>
> The name of my partial is "list", so, my understanding is that
rails
> will use the name of the partial for each element, so list=list.
>
> It doesn''t return an error; those rows just don''t
populate (meaning
> the html doesn''t get rendered, like the "each" is null.
>
> What am I missing?
>
> Steve
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>