浏览代码

Show number of posts on this layer

master
Adrian Short 11 年前
父节点
当前提交
040e81ece7
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. +3
    -0
      app/controllers/layers_controller.rb
  2. +1
    -1
      app/views/layers/show.html.haml

+ 3
- 0
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 }


+ 1
- 1
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


正在加载...
取消
保存