Hey.....Does nybody know how to display a list(array) as links
Eg: I've a @products and @categories enumerable objects supplied to the view
from a single CategoryController ...
I want to show the products under their respective categories as links and
get rid of the separate show page for displaying products list...

I was able to get the categories links working as expected... but products
name appear  simply as plain text.....
                         <% @categories.each do |cat| %>
                              <th>  <%=  link_to( cat.name, cat) %></th>
                        <tr><td> <%= cat.products.collect { |c|  c.name  }
%> </td></tr> ####-----I need links Here!!!!!!!!!!!!!!
                         <% end %>
...But if I put link_to inside the cat.products.collect { |c| link_to c.name,
c }, I get the html escaped text for links inside the[..]

Category and Product models have has_many_through relationship...

How to go about this......??????????

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to