Class: Workarea::Api::Storefront::AccountsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/api/storefront/accounts_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#assert_current_metrics_id, #cache_page, #skip_session

Methods included from Authentication

#authentication?, #current_user, find_user

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
16
# File 'app/controllers/workarea/api/storefront/accounts_controller.rb', line 8

def create
  @user = User.create!(user_params)

  Workarea::Storefront::AccountMailer
    .creation(@user.id.to_s)
    .deliver_later

  @authentication_token = @user.authentication_tokens.create!
end

#showObject



5
6
# File 'app/controllers/workarea/api/storefront/accounts_controller.rb', line 5

def show
end

#updateObject



18
19
20
21
# File 'app/controllers/workarea/api/storefront/accounts_controller.rb', line 18

def update
  current_user.update_attributes!(user_params)
  render :show
end