From 7be374ac480d312208140d55f91cc16b57cc7592 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 9 Aug 2010 10:10:41 -0700 Subject: [PATCH] MS IZ fixed a couple of view things as well as the dev db seed script --- app/controllers/people_controller.rb | 5 +++-- app/helpers/application_helper.rb | 4 +++- db/seeds/dev.rb | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 25fcdf2af..b93a9f059 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -2,14 +2,15 @@ class PeopleController < ApplicationController before_filter :authenticate_user! def index - @people = Person.friends.paginate :page => params[:page], :order => 'created_at DESC' + @people = current_user.friends.paginate :page => params[:page], :order => 'created_at DESC' end def show @person= Person.where(:id => params[:id]).first + @person_profile = @person.profile @person_posts = Post.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' - @latest_status_message = StatusMessage.newest(@person) + @latest_status_message = StatusMessage.newest_for(@person) @post_count = @person_posts.count end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 69011b563..bd0ede89b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -31,7 +31,9 @@ module ApplicationHelper end end - def link_to_person(person) + def link_to_person(user) + person = user.person + puts person.inspect link_to person.real_name, person_path(person) end diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index f59cb7848..dfc4d1c14 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -9,7 +9,8 @@ require 'config/environment' # Create seed user -user = User.create( :password => "evankorth", +user = User.create( :email => "robert@joindiaspora.com", + :password => "evankorth", :person => Person.create( :email => "robert@joindiaspora.com", :url => "http://localhost:3000/",