redirect to right object

git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@152 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7
master
andrew 2008-02-07 19:46:51 +00:00
parent d54081e452
commit fca57cf04e
1 changed files with 2 additions and 2 deletions

View File

@ -17,11 +17,11 @@ class FriendsController < ApplicationController
def create def create
@friend = Friend.new(params[:friend]) @friend = Friend.new(params[:friend])
@people = @friend.source @people = @friend.source
@page = @friend.destination @dest = @friend.destination
respond_to do |format| respond_to do |format|
if @friend.save if @friend.save
flash[:notice] = 'Successfully added the new friend' flash[:notice] = 'Successfully added the new friend'
format.html { redirect_to people_path(@page.title_for_url) } format.html { redirect_to people_path(@dest.page.title_for_url) }
else else
format.html { render :action => "new" } format.html { render :action => "new" }
end end