Sha256: f9748328e38fdb53e94233f2141ee697e96c00589d0d4a3f12c0a6804af55896

Contents?: true

Size: 965 Bytes

Versions: 28

Compression:

Stored size: 965 Bytes

Contents

require 'active_support/core_ext/module/attr_internal'

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)
          @_default_form_builder = controller.default_form_builder if controller.respond_to?(:default_form_builder)
        end
      end

      def logger
        controller.logger if controller.respond_to?(:logger)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 4 rubygems

Version Path
actionview-5.0.5.rc1 lib/action_view/helpers/controller_helper.rb
actionview-5.0.4 lib/action_view/helpers/controller_helper.rb
actionview-5.0.4.rc1 lib/action_view/helpers/controller_helper.rb
actionview-5.0.3 lib/action_view/helpers/controller_helper.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/actionview-5.0.2/lib/action_view/helpers/controller_helper.rb
actionview-5.0.2 lib/action_view/helpers/controller_helper.rb
actionview-5.0.2.rc1 lib/action_view/helpers/controller_helper.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/helpers/controller_helper.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/helpers/controller_helper.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/helpers/controller_helper.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/helpers/controller_helper.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/helpers/controller_helper.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/helpers/controller_helper.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/helpers/controller_helper.rb
abaci-0.3.0 vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/controller_helper.rb
actionview-5.0.1 lib/action_view/helpers/controller_helper.rb
actionview-5.0.1.rc2 lib/action_view/helpers/controller_helper.rb
actionview-5.0.1.rc1 lib/action_view/helpers/controller_helper.rb
actionview-5.0.0.1 lib/action_view/helpers/controller_helper.rb
actionview-5.0.0 lib/action_view/helpers/controller_helper.rb