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

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1584 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2005-07-01 18:21:29 +00:00
parent f2a29ca43c
commit f0e9fd74ae
2 changed files with 11 additions and 2 deletions

View File

@@ -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]) }))

View File

@@ -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