aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template.rb
diff options
context:
space:
mode:
authorNathan Weizenbaum <nex342@gmail.com>2008-12-15 14:49:38 -0600
committerJoshua Peek <josh@joshpeek.com>2008-12-15 14:49:38 -0600
commite8c1915416579a3840573ca2c80822d96cb31823 (patch)
tree99b7df0571b35701ab6e973024c25e5141c0da23 /actionpack/lib/action_view/template.rb
parenta392f34fb4069ab847ff631130d023cdaf896735 (diff)
downloadrails-e8c1915416579a3840573ca2c80822d96cb31823.tar.gz
rails-e8c1915416579a3840573ca2c80822d96cb31823.tar.bz2
rails-e8c1915416579a3840573ca2c80822d96cb31823.zip
Auto-load template handlers based on unmatched extensions [#1540 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r--actionpack/lib/action_view/template.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 93748638c3..8f4ca433c0 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -98,10 +98,6 @@ module ActionView #:nodoc:
end
private
- def valid_extension?(extension)
- Template.template_handler_extensions.include?(extension)
- end
-
def find_full_path(path, load_paths)
load_paths = Array(load_paths) + [nil]
load_paths.each do |load_path|
@@ -115,11 +111,11 @@ module ActionView #:nodoc:
# [base_path, name, format, extension]
def split(file)
if m = file.match(/^(.*\/)?([^\.]+)\.?(\w+)?\.?(\w+)?\.?(\w+)?$/)
- if valid_extension?(m[5]) # Multipart formats
+ if Template.valid_extension?(m[5]) # Multipart formats
[m[1], m[2], "#{m[3]}.#{m[4]}", m[5]]
- elsif valid_extension?(m[4]) # Single format
+ elsif Template.valid_extension?(m[4]) # Single format
[m[1], m[2], m[3], m[4]]
- elsif valid_extension?(m[3]) # No format
+ elsif Template.valid_extension?(m[3]) # No format
[m[1], m[2], nil, m[3]]
else # No extension
[m[1], m[2], m[3], nil]