2011-06-01 10:28:24 -04:00
|
|
|
require 'active_support/core_ext/module/attr_internal'
|
|
|
|
|
2011-05-04 06:04:29 -04:00
|
|
|
module ActionView
|
|
|
|
module Helpers
|
|
|
|
# This module keeps all methods and behavior in ActionView
|
|
|
|
# that simply delegates to the controller.
|
|
|
|
module ControllerHelper #:nodoc:
|
|
|
|
attr_internal :controller, :request
|
|
|
|
|
|
|
|
delegate :request_forgery_protection_token, :params, :session, :cookies, :response, :headers,
|
|
|
|
:flash, :action_name, :controller_name, :controller_path, :to => :controller
|
|
|
|
|
|
|
|
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)
|
|
|
|
end
|
|
|
|
end
|
2012-06-05 03:03:00 -04:00
|
|
|
|
|
|
|
def logger
|
2012-06-05 06:06:18 -04:00
|
|
|
controller.logger if controller.respond_to?(:logger)
|
2012-06-05 03:03:00 -04:00
|
|
|
end
|
2011-05-04 06:04:29 -04:00
|
|
|
end
|
|
|
|
end
|
2011-05-09 19:16:55 -04:00
|
|
|
end
|