Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.28 KB | None | 0 0
  1. class PeopleController < ApplicationController
  2.   def index
  3.   @people = Person.all
  4.   @article_count = @people.each{|c| Article.where(:person_id=>c.id).count }
  5.   #@people = Person.includes(:articles).count
  6.   end
  7.  
  8.   def show
  9.     @people = Person.find(params[:id])
  10.   end
  11.  
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement