Permalink
Browse files

Make render(:inline) use locals #1556 [Michael Shuerig]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1584 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f2a29ca commit f0e9fd74aed3d74e6ae8f53dbdcd1340d238cb57 @dhh dhh committed Jul 1, 2005
Showing with 11 additions and 2 deletions.
  1. +8 −1 actionpack/lib/action_controller/base.rb
  2. +3 −1 actionpack/lib/action_view/base.rb
@@ -471,7 +471,14 @@ def render(options = {}, deprecated_status = nil)
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]) }))
@@ -194,8 +194,10 @@ def render(options = {}, old_local_assigns = {})
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

0 comments on commit f0e9fd7

Please sign in to comment.