Module: ActionView::Helpers::ControllerHelper
Do not use. This module is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | actionview/lib/action_view/helpers/controller_helper.rb |
Overview
Action View Controller Helpers
This module keeps all methods and behavior in ::ActionView
that simply delegates to the controller.
Constant Summary
-
CONTROLLER_DELEGATES =
# File 'actionview/lib/action_view/helpers/controller_helper.rb', line 14[:request_forgery_protection_token, :params, :session, :, :response, :headers, :flash, :action_name, :controller_name, :controller_path]
Instance Attribute Summary
- #controller rw
- #request rw
Instance Method Summary
Instance Attribute Details
#controller (rw)
[ GitHub ]# File 'actionview/lib/action_view/helpers/controller_helper.rb', line 12
attr_internal :controller, :request
#request (rw)
[ GitHub ]# File 'actionview/lib/action_view/helpers/controller_helper.rb', line 12
attr_internal :controller, :request
Instance Method Details
#assign_controller(controller)
[ GitHub ]# File 'actionview/lib/action_view/helpers/controller_helper.rb', line 20
def assign_controller(controller) if @_controller = controller @_request = controller.request if controller.respond_to?(:request) @_config = controller.config.inheritable_copy if controller.respond_to?(:config) @_default_form_builder = controller.default_form_builder if controller.respond_to?(:default_form_builder) else @_request ||= nil @_config ||= nil @_default_form_builder ||= nil end end
#logger
[ GitHub ]# File 'actionview/lib/action_view/helpers/controller_helper.rb', line 32
def logger controller.logger if controller.respond_to?(:logger) end
#respond_to?(method_name, include_private = false) ⇒ Boolean
# File 'actionview/lib/action_view/helpers/controller_helper.rb', line 36
def respond_to?(method_name, include_private = false) return controller.respond_to?(method_name) if CONTROLLER_DELEGATES.include?(method_name.to_sym) super end