aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-04-21 11:39:46 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-04-21 11:53:14 +0100
commita04f0228776e7616c372f867a1212b5798cde80a (patch)
tree39f364456fa4decbb44bdad5019541d7ae7c7edb /actionpack/lib
parentf757f5838818ce35f7927a10a8cda6f9583869c5 (diff)
downloadrails-a04f0228776e7616c372f867a1212b5798cde80a.tar.gz
rails-a04f0228776e7616c372f867a1212b5798cde80a.tar.bz2
rails-a04f0228776e7616c372f867a1212b5798cde80a.zip
Delegate ivars to controller instead of copying
Reduce number of instance variables being copied from controller to view. Instead, delegate them to controller instance.
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-xactionpack/lib/action_controller/base.rb3
-rw-r--r--actionpack/lib/action_view/base.rb9
2 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 1aa027f9d7..0c0d0ec4ac 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -256,7 +256,8 @@ module ActionController #:nodoc:
# Controller specific instance variables which will not be accessible inside views.
@@protected_view_variables = %w(@assigns @performed_redirect @performed_render @variables_added @request_origin @url @parent_controller
- @action_name @before_filter_chain_aborted @action_cache_path)
+ @action_name @before_filter_chain_aborted @action_cache_path @_session @_cookies @_headers @_params
+ @_flash @_response)
# Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets,
# and images to a dedicated asset server away from the main web server. Example:
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 12dd7d2bc9..4ed20fec89 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -156,9 +156,6 @@ module ActionView #:nodoc:
attr_reader :finder
attr_accessor :base_path, :assigns, :template_extension, :first_render
attr_accessor :controller
-
- attr_reader :logger, :response, :headers
- attr_internal :cookies, :flash, :headers, :params, :request, :response, :session
attr_writer :template_format
attr_accessor :current_render_extension
@@ -185,7 +182,10 @@ module ActionView #:nodoc:
@@erb_variable = '_erbout'
cattr_accessor :erb_variable
- delegate :request_forgery_protection_token, :to => :controller
+ attr_internal :request
+
+ delegate :request_forgery_protection_token, :template, :params, :session, :cookies, :response, :headers,
+ :flash, :logger, :to => :controller
module CompiledTemplates #:nodoc:
# holds compiled template code
@@ -222,7 +222,6 @@ module ActionView #:nodoc:
@assigns = assigns_for_first_render
@assigns_added = nil
@controller = controller
- @logger = controller && controller.logger
@finder = TemplateFinder.new(self, view_paths)
end