Class: Cdx::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Cdx::ApplicationController
- Defined in:
- app/controllers/cdx/application_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods included from ControllerHelpers::Settings
Methods included from ControllerHelpers::Seo
#canonical_url, #contextual_record, #meta_data, #meta_title, #open_graph_data
Instance Method Details
#current_ability ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/cdx/application_controller.rb', line 8 def current_ability if try(:current_user) controller_name_segments = params[:controller].split('/') controller_name_segments.pop controller_namespace = controller_name_segments.join('/').camelize @current_ability ||= Ability.new(current_user, controller_namespace, Cdx::Site.current) end end |