<%= link_to "New Forum Category", new_category_path if can? :create, Category %>
<% @categories.each do |category| %>
<%= category.title %> <%= link_to "New Forum", new_forum_path if can? :create, Forum %> <%= link_to "Edit Category", edit_category_path(category) if can? :manage, category %> <%= link_to "Delete Category", category_path(category), :confirm => "Are you sure you want to delete this category?", :method => :delete if can? :manage, category %>
<% if category.forums.size > 0 %>
<% category.forums.each do |forum| %> <% end %>
Forum Topics Posts Last Post
<%= image_tag 'ruby.png' %> <%= link_to forum.title, forum_path(forum) %>
<%= forum.description %>
<%= forum.topics.size %> <%= forum.posts.size - forum.topics.size %> <% if forum.posts.size > 0 %> <%=l forum.posts.last.created_at %>
<%= forum.posts.last.user.username %> <% else %> No Topics / Posts <% end %>
<% else %>
There are currently no forums.
<% end %>
<% end %>