From af8448dd512ec665fb45b141845905308dec855a Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 19 Aug 2010 10:20:43 -0700 Subject: [PATCH] photos on the profile edit page now are only your photos, for now. also, no more remove friend button on your profile page --- app/controllers/users_controller.rb | 8 +++----- app/views/people/show.html.haml | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 10db48c04..c93c474fc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,8 +16,9 @@ class UsersController < ApplicationController def edit @user = User.first(:id => params[:id]) + @person = @user.person @profile = @user.profile - @photos = Photo.paginate :page => params[:page], :order => 'created_at DESC' + @photos = Photo.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' end def update @@ -30,7 +31,4 @@ class UsersController < ApplicationController render :action => 'edit' end end - - - -end +end diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index af8eb86ab..39c60ec7e 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -5,7 +5,8 @@ %h1 = @person.real_name - - unless @person.id == current_user.id + - unless @person.id == current_user.person.id + .right = link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button"