diff --git a/app/controllers/layers_controller.rb b/app/controllers/layers_controller.rb index e95fe31..fbc631e 100644 --- a/app/controllers/layers_controller.rb +++ b/app/controllers/layers_controller.rb @@ -19,6 +19,9 @@ 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 d1ef20f..562e29b 100644 --- a/app/views/layers/show.html.haml +++ b/app/views/layers/show.html.haml @@ -42,7 +42,7 @@ %tr %td - %td.right [number of posts in this layer] + %td.right= @layer_posts %td %td %td