Class: Wallaby::BaseController
- Inherits:
-
SecureController
- Object
- ApplicationController
- SecureController
- Wallaby::BaseController
- Defined in:
- app/controllers/wallaby/base_controller.rb
Overview
Base controller to provide basic helper methods for sub classes
Direct Known Subclasses
Constant Summary
Constants inherited from ApplicationController
ApplicationController::ERROR_PATH
Instance Method Summary collapse
-
#current_model_class ⇒ Class
The model class that links to the resources name.
-
#current_resources_name ⇒ String
The resources name coming from params.
Methods inherited from SecureController
#current_user, #forbidden, #security_config, #unauthorized
Methods inherited from ApplicationController
#bad_request, #configuration, configuration, #healthy, #not_found, #unprocessable_entity
Instance Method Details
#current_model_class ⇒ Class
Returns the model class that links to the resources name.
17 18 19 20 21 |
# File 'app/controllers/wallaby/base_controller.rb', line 17 def current_model_class @current_model_class ||= self.class.respond_to?(:model_class) && self.class.model_class \ || Map.model_class_map(current_resources_name) end |
#current_resources_name ⇒ String
Returns the resources name coming from params.
12 13 14 |
# File 'app/controllers/wallaby/base_controller.rb', line 12 def current_resources_name @current_resources_name ||= params[:resources] end |