aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/base.rb6
-rw-r--r--actionpack/test/controller/new_render_test.rb4
-rw-r--r--actionpack/test/fixtures/test/hello_world.builder4
3 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 228e3f55a5..24cbdcf81d 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -252,6 +252,10 @@ module ActionView #:nodoc:
@@template_handlers[extension.to_sym] || @@default_template_handlers
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_template_handler :rjs, TemplateHandlers::RJS
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)
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)
return formatted ? "#{template_format}.#{extension}" : extension.to_s
end
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 8a3013bec6..3168daeaec 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -241,11 +241,11 @@ class NewRenderTestController < ActionController::Base
end
def hello_world_from_rxml_using_action
- render :action => "hello_world.builder"
+ render :action => "hello_world_from_rxml.builder"
end
def hello_world_from_rxml_using_template
- render :template => "test/hello_world.builder"
+ render :template => "test/hello_world_from_rxml.builder"
end
def head_with_location_header
diff --git a/actionpack/test/fixtures/test/hello_world.builder b/actionpack/test/fixtures/test/hello_world.builder
deleted file mode 100644
index 8455b11edc..0000000000
--- a/actionpack/test/fixtures/test/hello_world.builder
+++ /dev/null
@@ -1,4 +0,0 @@
-xml.html do
- xml.p "Hello"
-end
-"String return value"