diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-10 20:41:59 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-10 20:41:59 +0000 |
commit | 93ec552e9b76be7491dfe06c09e0e636dfd0d3a3 (patch) | |
tree | c96c94849607623f0701479f62d7cce67a8e67af /actionpack/lib | |
parent | fade31ad0581361c7b4e49a8b223e4c52094fec0 (diff) | |
download | rails-93ec552e9b76be7491dfe06c09e0e636dfd0d3a3.tar.gz rails-93ec552e9b76be7491dfe06c09e0e636dfd0d3a3.tar.bz2 rails-93ec552e9b76be7491dfe06c09e0e636dfd0d3a3.zip |
Fix up template handler tests. Closes #10437.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 6 |
1 files changed, 5 insertions, 1 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 |