mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 02:33:03 -04:00
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
17 lines
416 B
Plaintext
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 }
|
|
|