From 583d3d0c82af034298babd7eb4520fc5baacd07f Mon Sep 17 00:00:00 2001 From: maxwell <maxwell@joindiaspora.com> Date: Thu, 8 Jul 2010 21:34:38 -0700 Subject: [PATCH] DG MS friending now tests out --- app/controllers/requests_controller.rb | 4 +--- app/models/user.rb | 1 + app/views/people/index.html.haml | 2 +- app/views/requests/_form.haml | 2 +- app/views/requests/_request.html.haml | 1 + lib/tasks/db.rake | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index d8fd3fd60b..3f6099a123 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -24,11 +24,9 @@ class RequestsController < ApplicationController if @request flash[:notice] = "Successfully created person request." - redirect_to person_requests_url + redirect_to requests_url else render :action => 'new' end end - - end diff --git a/app/models/user.rb b/app/models/user.rb index 772ad6b0e7..6a6f0df5d2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -29,6 +29,7 @@ class User < Person p = Request.instantiate(:to => friend_url, :from => self) if p.save p.push_to_url friend_url + p end end diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 4d743a8f47..efb46e6444 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -13,7 +13,7 @@ %td= link_to 'Show', person %td= link_to 'Destroy', person, :confirm => 'Are you sure?', :method => :delete -%p= link_to "Add a friend", new_person_request_path +%p= link_to "Add a friend", new_request_path #pagination = will_paginate @people diff --git a/app/views/requests/_form.haml b/app/views/requests/_form.haml index 3241d21a56..390062d8d5 100644 --- a/app/views/requests/_form.haml +++ b/app/views/requests/_form.haml @@ -3,7 +3,7 @@ %p = f.label :destination_url - = f.text_field :destiation_url + = f.text_field :destination_url %p diff --git a/app/views/requests/_request.html.haml b/app/views/requests/_request.html.haml index 1fcff3bb43..5e5763d1f8 100644 --- a/app/views/requests/_request.html.haml +++ b/app/views/requests/_request.html.haml @@ -1,5 +1,6 @@ %li.message{:id => request.id, :class => "mine"} = "to : #{request.destination_url}" + = request.person.class .destroy_link = link_to 'Ignore', request_path(request), :confirm => 'Are you sure?', :method => :delete, :remote => true diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index a6fe26ef64..ceb7a72ada 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -23,7 +23,7 @@ namespace :db do Person.delete_all User.delete_all Profile.delete_all - PersonRequest.delete_all + Request.delete_all end desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb' -- GitLab