diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index d8fd3fd60..3f6099a12 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 772ad6b0e..6a6f0df5d 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 4d743a8f4..efb46e644 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 3241d21a5..390062d8d 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 1fcff3bb4..5e5763d1f 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 a6fe26ef6..ceb7a72ad 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'