Permalink
Browse files

Consistent default handling in ActionView render. Closes #6534.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 0ee5d64 commit 99b607d7171c246273abd7045428e37ba23ce350 @jeremy jeremy committed Nov 2, 2006
Showing with 2 additions and 3 deletions.
  1. +2 −3 actionpack/lib/action_view/base.rb
@@ -276,8 +276,7 @@ def render(options = {}, old_local_assigns = {}, &block) #:nodoc:
elsif options == :update
update_page(&block)
elsif options.is_a?(Hash)
- options[:locals] ||= {}
- options[:use_full_path] = options[:use_full_path].nil? ? true : options[:use_full_path]
+ options = options.reverse_merge(:type => :rhtml, :locals => {}, :use_full_path => true)
if options[:file]
render_file(options[:file], options[:use_full_path], options[:locals])
@@ -286,7 +285,7 @@ def render(options = {}, old_local_assigns = {}, &block) #:nodoc:
elsif options[:partial]
render_partial(options[:partial], ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals])
elsif options[:inline]
- render_template(options[:type] || :rhtml, options[:inline], nil, options[:locals] || {})
+ render_template(options[:type], options[:inline], nil, options[:locals])
end
end
end

0 comments on commit 99b607d

Please sign in to comment.