Displaying 1 result from an estimated 1 matches for "linkcategory".
2006 Apr 14
1
Grouping a list of links by category
Hi,
I want to display a list of links grouped by category like this:
Group 1
Link 1
Link 2
Group 2
Link 1
Link 2
I have this in my controller:
def index
@links = Link.find(:all, :order => "category_id")
end
And this in the view:
<ul>
<% for link in @links %>
<li>
<a href="<%= link.url %>"><%= link.link