aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorSam Stephenson <sam@37signals.com>2005-11-22 08:37:04 +0000
committerSam Stephenson <sam@37signals.com>2005-11-22 08:37:04 +0000
commitbea737eb5a5f51ee7fbc2e60d870cee5936bdfb0 (patch)
tree4c7f1d9df0b5db914648cf5742a7f953c60433e5 /actionpack/lib/action_controller/base.rb
parent130c493a4ff295723fa08935c71b89badef06cdc (diff)
downloadrails-bea737eb5a5f51ee7fbc2e60d870cee5936bdfb0.tar.gz
rails-bea737eb5a5f51ee7fbc2e60d870cee5936bdfb0.tar.bz2
rails-bea737eb5a5f51ee7fbc2e60d870cee5936bdfb0.zip
Make ActionController's render honor the :locals option when rendering a :file. Closes #1665.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 225a61f43e..9aab2c5028 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -459,6 +459,10 @@ module ActionController #:nodoc:
self.class.controller_name
end
+ def session_enabled?
+ request.session_options[:disabled] != false
+ end
+
protected
# Renders the content that will be returned to the browser as the response body.
#
@@ -596,7 +600,7 @@ module ActionController #:nodoc:
else
if file = options[:file]
- render_file(file, options[:status], options[:use_full_path])
+ render_file(file, options[:status], options[:use_full_path], options[:locals] || {})
elsif template = options[:template]
render_file(template, options[:status], true)
@@ -645,11 +649,11 @@ module ActionController #:nodoc:
end
end
- def render_file(template_path, status = nil, use_full_path = false)
+ def render_file(template_path, status = nil, use_full_path = false, locals = {})
add_variables_to_assigns
assert_existance_of_template_file(template_path) if use_full_path
logger.info("Rendering #{template_path}" + (status ? " (#{status})" : '')) if logger
- render_text(@template.render_file(template_path, use_full_path), status)
+ render_text(@template.render_file(template_path, use_full_path, locals), status)
end
def render_template(template, status = nil, type = :rhtml, local_assigns = {})