public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
insoshi / app / controllers / people_controller.rb
100644 35 lines (28 sloc) 0.679 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class PeopleController < ApplicationController
  
  
  def new
  end
 
  def create
    cookies.delete :auth_token
    @person = Person.new(params[:person])
    @person.save
    if @person.errors.empty?
      self.current_person = @person
      redirect_back_or_default('/')
      flash[:notice] = "Thanks for signing up!"
    else
      render :action => 'new'
    end
  end
 
 
  def edit
  end
 
  def update
    respond_to do |format|
      if current_person.update_attributes(params[:person])
        flash[:success] = 'Profile updated!'
        format.html { redirect_to(current_person) }
      else
        format.html { render :action => "edit" }
      end
    end
  end
end