Class: Api::V1::AccountsController

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

Instance Method Summary collapse

Methods inherited from BaseController

#catalog_for_request, #error!, #locale_for_request, #logger, #render_bad_request_response, #render_internal_server_error, #render_not_found_response, #render_result, #render_unprocessable_entity_response, #set_locale, #store_for_request, #underscore_params

Instance Method Details

#auth_methodsObject

Return valid authentication methods
GET /accounts/:email/auth_methods



23
24
25
# File 'app/controllers/api/v1/accounts_controller.rb', line 23

def auth_methods
  render json: @account.authentication_methods
end

#indexObject

Returns last 10 created online accounts if admin is signed in
GET /accounts



10
11
12
13
# File 'app/controllers/api/v1/accounts_controller.rb', line 10

def index
  @accounts = Account.order(:created_at).limit(10)
  render json: @accounts
end

#showObject

Return account details for email
GET /accounts/:email



17
18
19
# File 'app/controllers/api/v1/accounts_controller.rb', line 17

def show
  render json: @account
end