aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-29 16:49:26 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-29 17:51:05 +0100
commit986a4e616be715e5c5a6ebbd25d339fa9bba4072 (patch)
tree29f2051bc1f51785662035a1d4740d287ff817a0 /actionpack
parentba82eb2efa24c9124fc4b3dac65c7b7494022f99 (diff)
downloadrails-986a4e616be715e5c5a6ebbd25d339fa9bba4072.tar.gz
rails-986a4e616be715e5c5a6ebbd25d339fa9bba4072.tar.bz2
rails-986a4e616be715e5c5a6ebbd25d339fa9bba4072.zip
Fix rendering of layouts.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb3
-rw-r--r--actionpack/lib/action_controller/metal/rendering.rb5
-rw-r--r--actionpack/test/abstract/render_test.rb6
3 files changed, 5 insertions, 9 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index 1dec3f2c3e..40cac40ba7 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -157,7 +157,8 @@ module AbstractController
options[:_template_name] = options[:file]
end
- name = (options[:_template_name] || action_name).to_s
+ name = (options[:_template_name] || options[:action] || action_name).to_s
+ options[:_prefix] ||= _prefix if (options.keys & [:partial, :file, :template]).empty?
options[:_template] ||= with_template_cache(name) do
find_template(name, { :formats => formats }, options)
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb
index 8f03035b2b..0aae9f8579 100644
--- a/actionpack/lib/action_controller/metal/rendering.rb
+++ b/actionpack/lib/action_controller/metal/rendering.rb
@@ -58,11 +58,6 @@ module ActionController
options.merge! :partial => action
end
- if (options.keys & [:partial, :file, :template, :text, :inline]).empty?
- options[:_template_name] ||= options[:action]
- options[:_prefix] = _prefix
- end
-
if options[:status]
options[:status] = Rack::Utils.status_code(options[:status])
end
diff --git a/actionpack/test/abstract/render_test.rb b/actionpack/test/abstract/render_test.rb
index ffd430fa86..9a0a140bee 100644
--- a/actionpack/test/abstract/render_test.rb
+++ b/actionpack/test/abstract/render_test.rb
@@ -11,13 +11,13 @@ module AbstractController
end
self.view_paths = [ActionView::FixtureResolver.new(
- "default.erb" => "With Default",
"template.erb" => "With Template",
+ "renderer/default.erb" => "With Default",
"renderer/string.erb" => "With String",
"renderer/symbol.erb" => "With Symbol",
+ "renderer/template_name.erb" => "With Template Name",
"string/with_path.erb" => "With String With Path",
- "some/file.erb" => "With File",
- "template_name.erb" => "With Template Name"
+ "some/file.erb" => "With File"
)]
def template