Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 37 lines (31 sloc) 0.774 kB
f45fdd1 @binarylogic Initial commit
authored
1 class UsersController < ApplicationController
569eb0b @binarylogic Updated with new password reset method
authored
2 before_filter :require_no_user, :only => [:new, :create]
f45fdd1 @binarylogic Initial commit
authored
3 before_filter :require_user, :only => [:show, :edit, :update]
4
5 def new
6 @user = User.new
7 end
8
9 def create
10 @user = User.new(params[:user])
11 if @user.save
12 flash[:notice] = "Account registered!"
13 redirect_back_or_default account_url
14 else
15 render :action => :new
16 end
17 end
18
19 def show
20 @user = @current_user
21 end
22
63cac21 @binarylogic Updated code with authlogic
authored
23 def edit
24 @user = @current_user
25 end
f45fdd1 @binarylogic Initial commit
authored
26
27 def update
28 @user = @current_user # makes our views "cleaner" and more consistent
29 if @user.update_attributes(params[:user])
30 flash[:notice] = "Account updated!"
31 redirect_to account_url
32 else
33 render :action => :edit
34 end
35 end
36 end
Something went wrong with that request. Please try again.