Fix rendering of layouts.

This commit is contained in:
José Valim
2010-01-29 16:49:26 +01:00
parent ba82eb2efa
commit 986a4e616b
3 changed files with 5 additions and 9 deletions

View File

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

View File

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

View File

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