aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-08-30 15:49:56 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-30 15:49:56 -0700
commitf7d9e09eeec0ff24d19dfcf926555c58918b1bcc (patch)
treef4fd883612e90b4b684672e2428f0ddbf0496a62
parentb163d83b8bab9103dc0e73b86212c2629cb45ca2 (diff)
parent4fb75392aa12228764758dfda95f02f83b8ce3fe (diff)
downloadrails-f7d9e09eeec0ff24d19dfcf926555c58918b1bcc.tar.gz
rails-f7d9e09eeec0ff24d19dfcf926555c58918b1bcc.tar.bz2
rails-f7d9e09eeec0ff24d19dfcf926555c58918b1bcc.zip
Merge branch 'master' of git@github.com:rails/rails
-rw-r--r--actionpack/lib/action_controller/base.rb2
-rw-r--r--actionpack/lib/action_controller/layout.rb2
-rw-r--r--actionpack/test/controller/render_test.rb13
3 files changed, 15 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 3b0f19475e..a1b210a54f 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -897,7 +897,7 @@ module ActionController #:nodoc:
render_for_text(@template.render(options), options[:status])
elsif action_name = options[:action]
- render_for_file(default_template_name(action_name.to_s), options[:status], nil, options[:locals] || {})
+ render_for_file(default_template_name(action_name.to_s), options[:status])
elsif xml = options[:xml]
response.content_type ||= Mime::XML
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb
index 8b6febe254..fd743ced38 100644
--- a/actionpack/lib/action_controller/layout.rb
+++ b/actionpack/lib/action_controller/layout.rb
@@ -245,7 +245,7 @@ module ActionController #:nodoc:
template_with_options = options.is_a?(Hash)
if (layout = pick_layout(template_with_options, options)) && apply_layout?(template_with_options, options)
- options = options.merge :layout => false if template_with_options
+ options.delete(:layout) if template_with_options
logger.info("Rendering template within #{layout}") if logger
content_for_layout = render_with_no_layout(options, extra_options, &block)
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index e383fda384..8d15aa2da4 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -371,6 +371,12 @@ class TestController < ActionController::Base
end
end
+ def update_page_with_view_method
+ render :update do |page|
+ page.replace_html 'person', pluralize(2, 'person')
+ end
+ end
+
def action_talk_to_layout
# Action template sets variable that's picked up by layout
end
@@ -1022,6 +1028,13 @@ class RenderTest < Test::Unit::TestCase
assert_match /\$37/, @response.body
end
+ def test_update_page_with_view_method
+ get :update_page_with_view_method
+ assert_template nil
+ assert_equal 'text/javascript; charset=utf-8', @response.headers['type']
+ assert_match /2 people/, @response.body
+ end
+
def test_yield_content_for
assert_not_deprecated { get :yield_content_for }
assert_equal "<title>Putting stuff in the title!</title>\n\nGreat stuff!\n", @response.body