Bläddra i källkod

Show number of posts on this layer

master
Adrian Short 11 år sedan
förälder
incheckning
040e81ece7
2 ändrade filer med 4 tillägg och 1 borttagningar
  1. +3
    -0
      app/controllers/layers_controller.rb
  2. +1
    -1
      app/views/layers/show.html.haml

+ 3
- 0
app/controllers/layers_controller.rb Visa fil

@@ -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 Visa fil

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

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


Laddar…
Avbryt
Spara