Class: BlazerJsonApi::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- BlazerJsonApi::ApplicationController
- Defined in:
- app/controllers/blazer_json_api/application_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
- #check_authentication ⇒ Object
- #record_not_found ⇒ Object
- #render_errors(error_messages, status: :bad_request) ⇒ Object
Instance Method Details
#check_authentication ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/blazer_json_api/application_controller.rb', line 21 def check_authentication return if BlazerJsonAPI.credentials_provided? render_errors(['Authentication credentials not set'], status: :unauthorized) end |
#record_not_found ⇒ Object
13 14 15 |
# File 'app/controllers/blazer_json_api/application_controller.rb', line 13 def record_not_found render json: [], status: :not_found end |
#render_errors(error_messages, status: :bad_request) ⇒ Object
17 18 19 |
# File 'app/controllers/blazer_json_api/application_controller.rb', line 17 def render_errors(, status: :bad_request) render json: { errors: }, status: status end |