Class: Spree::Admin::Users::ApiKeyController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/admin/users/api_key_controller.rb

Instance Method Summary collapse

Methods included from SetsUserLanguageLocaleKey

#set_user_language_locale_key

Instance Method Details

#createObject



7
8
9
10
11
12
# File 'app/controllers/spree/admin/users/api_key_controller.rb', line 7

def create
  if user.generate_spree_api_key!
    flash[:success] = t('spree.admin.api.key_generated')
  end
  redirect_to edit_admin_user_path(user)
end

#destroyObject



14
15
16
17
18
19
# File 'app/controllers/spree/admin/users/api_key_controller.rb', line 14

def destroy
  if user.clear_spree_api_key!
    flash[:success] = t('spree.admin.api.key_cleared')
  end
  redirect_to edit_admin_user_path(user)
end