diff --git a/app/controllers/layers_controller.rb b/app/controllers/layers_controller.rb index fbc631e..e95fe31 100644 --- a/app/controllers/layers_controller.rb +++ b/app/controllers/layers_controller.rb @@ -19,9 +19,6 @@ class LayersController < ApplicationController @feed = Feed.new @feed.new_layer_id = @layer.id - @layer_posts = 0 - @layer.feeds.each { |f| @layer_posts += f.posts.size } - respond_to do |format| format.html # show.html.erb format.json { render json: @layer } diff --git a/app/views/layers/show.html.haml b/app/views/layers/show.html.haml index 562e29b..2187688 100644 --- a/app/views/layers/show.html.haml +++ b/app/views/layers/show.html.haml @@ -24,8 +24,9 @@ %th %th %th - + - @layer_posts = 0 - @layer.feeds.each do |f| + - @layer_posts += f.posts.count %tr %td .feed_title