Explorar el Código

Show number of posts on this layer

master
Adrian Short hace 11 años
padre
commit
040e81ece7
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. +3
    -0
      app/controllers/layers_controller.rb
  2. +1
    -1
      app/views/layers/show.html.haml

+ 3
- 0
app/controllers/layers_controller.rb Ver fichero

@@ -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 Ver fichero

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

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


Cargando…
Cancelar
Guardar