Class: Api::V1::AccountsController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- Api::V1::AccountsController
- Defined in:
- app/controllers/api/v1/accounts_controller.rb
Instance Method Summary collapse
-
#auth_methods ⇒ Object
Return valid authentication methods GET /accounts/:email/auth_methods.
-
#index ⇒ Object
Returns last 10 created online accounts if admin is signed in GET /accounts.
-
#show ⇒ Object
Return account details for email GET /accounts/:email.
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_methods ⇒ Object
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 |
#index ⇒ Object
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 |
#show ⇒ Object
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 |