Class: Tramway::Api::ApplicationController
- Inherits:
-
Core::ApplicationController
- Object
- Core::ApplicationController
- Tramway::Api::ApplicationController
show all
- Includes:
- Knock::Authenticable
- Defined in:
- app/controllers/tramway/api/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#authenticate ⇒ Object
18
19
20
21
22
|
# File 'app/controllers/tramway/api/application_controller.rb', line 18
def authenticate
return if current_tramway_user || params[:user_based_model].in?(Tramway::Api.user_based_models)
unauthorized
end
|
#not_found ⇒ Object
10
11
12
|
# File 'app/controllers/tramway/api/application_controller.rb', line 10
def not_found
render json: { data: [] }, status: :not_found
end
|
#unauthorized ⇒ Object
14
15
16
|
# File 'app/controllers/tramway/api/application_controller.rb', line 14
def unauthorized
head :unauthorized
end
|