aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-01 18:21:29 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-01 18:21:29 +0000
commitf0e9fd74aed3d74e6ae8f53dbdcd1340d238cb57 (patch)
treefada5bc40c3d45f65de57f35f87c311679743def /actionpack
parentf2a29ca43cb0de38a25bf7f68bca5c11871692ce (diff)
downloadrails-f0e9fd74aed3d74e6ae8f53dbdcd1340d238cb57.tar.gz
rails-f0e9fd74aed3d74e6ae8f53dbdcd1340d238cb57.tar.bz2
rails-f0e9fd74aed3d74e6ae8f53dbdcd1340d238cb57.zip
Make render(:inline) use locals #1556 [Michael Shuerig]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1584 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rwxr-xr-xactionpack/lib/action_controller/base.rb9
-rw-r--r--actionpack/lib/action_view/base.rb4
2 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 2e0d554a55..91ebc7e69d 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -471,7 +471,14 @@ module ActionController #:nodoc:
render(options.merge({ :file => options[:template], :use_full_path => true }))
elsif options[:inline]
- render(options.merge({ :text => @template.render_template(options[:type] || :rhtml, options[:inline]) }))
+ render(options.merge({
+ :text =>
+ @template.render_template(
+ options[:type] || :rhtml,
+ options[:inline],
+ options[:locals] || {}
+ )
+ }))
elsif options[:action]
render(options.merge({ :template => default_template_name(options[:action]) }))
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 9a4e00057a..b6df4ba917 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -194,8 +194,10 @@ module ActionView #:nodoc:
render_file(options[:file], options[:use_full_path], options[:locals])
elsif options[:partial] && options[:collection]
render_partial_collection(options[:partial], options[:collection], options[:spacer_template], options[:locals])
- elsif options.is_a?(Hash) && options[:partial]
+ elsif options[:partial]
render_partial(options[:partial], options[:object], options[:locals])
+ elsif options[:inline]
+ render_template(options[:type] || :rhtml, options[:inline], options[:locals] || {})
end
end
end