DG MS friending now tests out

This commit is contained in:
maxwell 2010-07-08 21:34:38 -07:00
parent e1834cc887
commit 583d3d0c82
6 changed files with 6 additions and 6 deletions

View file

@ -24,11 +24,9 @@ class RequestsController < ApplicationController
if @request if @request
flash[:notice] = "Successfully created person request." flash[:notice] = "Successfully created person request."
redirect_to person_requests_url redirect_to requests_url
else else
render :action => 'new' render :action => 'new'
end end
end end
end end

View file

@ -29,6 +29,7 @@ class User < Person
p = Request.instantiate(:to => friend_url, :from => self) p = Request.instantiate(:to => friend_url, :from => self)
if p.save if p.save
p.push_to_url friend_url p.push_to_url friend_url
p
end end
end end

View file

@ -13,7 +13,7 @@
%td= link_to 'Show', person %td= link_to 'Show', person
%td= link_to 'Destroy', person, :confirm => 'Are you sure?', :method => :delete %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 #pagination
= will_paginate @people = will_paginate @people

View file

@ -3,7 +3,7 @@
%p %p
= f.label :destination_url = f.label :destination_url
= f.text_field :destiation_url = f.text_field :destination_url
%p %p

View file

@ -1,5 +1,6 @@
%li.message{:id => request.id, :class => "mine"} %li.message{:id => request.id, :class => "mine"}
= "to : #{request.destination_url}" = "to : #{request.destination_url}"
= request.person.class
.destroy_link .destroy_link
= link_to 'Ignore', request_path(request), :confirm => 'Are you sure?', :method => :delete, :remote => true = link_to 'Ignore', request_path(request), :confirm => 'Are you sure?', :method => :delete, :remote => true

View file

@ -23,7 +23,7 @@ namespace :db do
Person.delete_all Person.delete_all
User.delete_all User.delete_all
Profile.delete_all Profile.delete_all
PersonRequest.delete_all Request.delete_all
end end
desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb' desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb'