Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UsersController
- Defined in:
- lib/generators/authlogic/complete/templates/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/generators/authlogic/complete/templates/users_controller.rb', line 10 def create @user = User.new(params[:user]) if @user.save flash[:notice] = "Account registered!" redirect_back_or_default account_path else render :action => :new end end |
#edit ⇒ Object
24 25 26 |
# File 'lib/generators/authlogic/complete/templates/users_controller.rb', line 24 def edit @user = current_user end |
#new ⇒ Object
6 7 8 |
# File 'lib/generators/authlogic/complete/templates/users_controller.rb', line 6 def new @user = User.new end |
#show ⇒ Object
20 21 22 |
# File 'lib/generators/authlogic/complete/templates/users_controller.rb', line 20 def show @user = current_user end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/generators/authlogic/complete/templates/users_controller.rb', line 28 def update @user = @current_user # makes our views "cleaner" and more consistent if @user.update_attributes(params[:user]) flash[:notice] = "Account updated!" redirect_to account_path else render :action => :edit end end |