Pārlūkot izejas kodu

Show number of posts on this layer

master
Adrian Short pirms 11 gadiem
vecāks
revīzija
040e81ece7
2 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. +3
    -0
      app/controllers/layers_controller.rb
  2. +1
    -1
      app/views/layers/show.html.haml

+ 3
- 0
app/controllers/layers_controller.rb Parādīt failu

@@ -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 Parādīt failu

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

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


Notiek ielāde…
Atcelt
Saglabāt