Class: Spree::UsersController
- Inherits:
-
BaseController
- Object
- BaseController
- Spree::UsersController
- Includes:
- Core::ControllerHelpers::Order
- Defined in:
- app/controllers/spree/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/spree/users_controller.rb', line 12 def create @user = Spree::User.new(params[:user]) if @user.save if current_order session[:guest_token] = nil end redirect_back_or_default(root_url) else render :new end end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/spree/users_controller.rb', line 8 def show @orders = @user.orders.complete end |
#update ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/spree/users_controller.rb', line 26 def update if @user.update_attributes(params[:user]) if params[:user][:password].present? # this logic needed b/c devise wants to log us out after password changes user = Spree::User.reset_password_by_token(params[:user]) sign_in(@user, :event => :authentication, :bypass => !Spree::Auth::Config[:signout_after_password_change]) end redirect_to spree.account_url, :notice => t(:account_updated) else render :edit end end |