Browse Source

Show number of posts on this layer

master
Adrian Short 11 years ago
parent
commit
040e81ece7
2 changed files with 4 additions and 1 deletions
  1. +3
    -0
      app/controllers/layers_controller.rb
  2. +1
    -1
      app/views/layers/show.html.haml

+ 3
- 0
app/controllers/layers_controller.rb View File

@@ -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 }


+ 1
- 1
app/views/layers/show.html.haml View File

@@ -42,7 +42,7 @@

%tr
%td
%td.right [number of posts in this layer]
%td.right= @layer_posts
%td
%td
%td


Loading…
Cancel
Save