Class: Sprangular::AccountsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/sprangular/accounts_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#invalid_resource!, #not_found, #unauthorized

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
# File 'app/controllers/sprangular/accounts_controller.rb', line 4

def create
  @user = Spree::User.create(spree_user_params)

  (:spree_user, @user) if @user.persisted?
  @order = current_order

  render 'show'
end

#showObject



13
14
15
16
# File 'app/controllers/sprangular/accounts_controller.rb', line 13

def show
  authorize! :show, @user
  @order = current_order
end

#updateObject



18
19
20
21
22
23
24
# File 'app/controllers/sprangular/accounts_controller.rb', line 18

def update
  authorize! :update, @user
  @user.update_attributes spree_user_params
  @order = current_order

  render 'show'
end