mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix up template handler tests. Closes #10437.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
fade31ad05
commit
93ec552e9b
3 changed files with 7 additions and 7 deletions
|
@ -252,6 +252,10 @@ module ActionView #:nodoc:
|
||||||
@@template_handlers[extension.to_sym] || @@default_template_handlers
|
@@template_handlers[extension.to_sym] || @@default_template_handlers
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.template_handler_extensions
|
||||||
|
@@template_handler_extensions ||= @@template_handlers.keys.map(&:to_s).sort
|
||||||
|
end
|
||||||
|
|
||||||
register_default_template_handler :erb, TemplateHandlers::ERB
|
register_default_template_handler :erb, TemplateHandlers::ERB
|
||||||
register_template_handler :rjs, TemplateHandlers::RJS
|
register_template_handler :rjs, TemplateHandlers::RJS
|
||||||
register_template_handler :builder, TemplateHandlers::Builder
|
register_template_handler :builder, TemplateHandlers::Builder
|
||||||
|
@ -500,7 +504,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn
|
||||||
def find_template_extension_from_handler(template_path, formatted = nil)
|
def find_template_extension_from_handler(template_path, formatted = nil)
|
||||||
checked_template_path = formatted ? "#{template_path}.#{template_format}" : template_path
|
checked_template_path = formatted ? "#{template_path}.#{template_format}" : template_path
|
||||||
|
|
||||||
@@template_handlers.each do |extension,|
|
self.class.template_handler_extensions.each do |extension|
|
||||||
if template_exists?(checked_template_path, extension)
|
if template_exists?(checked_template_path, extension)
|
||||||
return formatted ? "#{template_format}.#{extension}" : extension.to_s
|
return formatted ? "#{template_format}.#{extension}" : extension.to_s
|
||||||
end
|
end
|
||||||
|
|
|
@ -241,11 +241,11 @@ class NewRenderTestController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def hello_world_from_rxml_using_action
|
def hello_world_from_rxml_using_action
|
||||||
render :action => "hello_world.builder"
|
render :action => "hello_world_from_rxml.builder"
|
||||||
end
|
end
|
||||||
|
|
||||||
def hello_world_from_rxml_using_template
|
def hello_world_from_rxml_using_template
|
||||||
render :template => "test/hello_world.builder"
|
render :template => "test/hello_world_from_rxml.builder"
|
||||||
end
|
end
|
||||||
|
|
||||||
def head_with_location_header
|
def head_with_location_header
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
xml.html do
|
|
||||||
xml.p "Hello"
|
|
||||||
end
|
|
||||||
"String return value"
|
|
Loading…
Reference in a new issue