aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/controller_helper.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-04 12:04:29 +0200
committerJosé Valim <jose.valim@gmail.com>2011-05-04 12:07:37 +0200
commit1632a3a49fb318be25d832b7efb17093bd7ef8ae (patch)
tree7059e65539d67ca38ca7ce8c1c9e3d0482acadd2 /actionpack/lib/action_view/helpers/controller_helper.rb
parent30bb17e5e09571396d1e7896888780e5cee840b6 (diff)
downloadrails-1632a3a49fb318be25d832b7efb17093bd7ef8ae.tar.gz
rails-1632a3a49fb318be25d832b7efb17093bd7ef8ae.tar.bz2
rails-1632a3a49fb318be25d832b7efb17093bd7ef8ae.zip
More AV::Base cleanup.
Diffstat (limited to 'actionpack/lib/action_view/helpers/controller_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/controller_helper.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/controller_helper.rb b/actionpack/lib/action_view/helpers/controller_helper.rb
new file mode 100644
index 0000000000..e22331cb3c
--- /dev/null
+++ b/actionpack/lib/action_view/helpers/controller_helper.rb
@@ -0,0 +1,21 @@
+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
+
+ delegate :logger, :to => :controller, :allow_nil => true
+
+ 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
+ end
+ end
+end \ No newline at end of file