Files
growstuff/app/views/forums/index.html.haml
Cjay Billones bb88041fef [Refactoring] Replace .count and .length with .size for collections
Improved program efficiency (in querying in particular) by replacing .count and .length with .size for collections.

Fix error in refactoring

Reverted some .size into .count
2015-06-25 12:09:03 +08:00

17 lines
416 B
Plaintext

- content_for :title, "Forums"
- if can? :create, Forum
%p
= link_to "New forum", new_forum_path, :class => 'btn btn-default'
- @forums.each do |forum|
%h2= forum
%p
= pluralize(forum.posts.size, "post")
|
=link_to "Visit forum", forum
|
=link_to "Post", new_post_path(:forum_id => forum.id)
=render :partial => "posts/summary", :locals => { :posts => forum.posts, :howmany => 4 }