Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PeopleController < ApplicationController
- def index
- @people = Person.all
- @article_count = @people.each{|c| Article.where(:person_id=>c.id).count }
- #@people = Person.includes(:articles).count
- end
- def show
- @people = Person.find(params[:id])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement