aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-03-18 11:57:05 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-03-18 12:21:28 -0700
commitd0c745b8634be3bd830bc93998f199e18bebef49 (patch)
treeeaf7422b0dd95eb420153bcdee20228558919150 /actionview/lib/action_view
parent98d0f93506b0b97804d0d510ffcc435af9b2a2d5 (diff)
downloadrails-d0c745b8634be3bd830bc93998f199e18bebef49.tar.gz
rails-d0c745b8634be3bd830bc93998f199e18bebef49.tar.bz2
rails-d0c745b8634be3bd830bc93998f199e18bebef49.zip
Remove virtual_path from fallback templates
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/template/resolver.rb24
1 files changed, 16 insertions, 8 deletions
diff --git a/actionview/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb
index 07c44307ff..1c577348e5 100644
--- a/actionview/lib/action_view/template/resolver.rb
+++ b/actionview/lib/action_view/template/resolver.rb
@@ -184,17 +184,21 @@ module ActionView
template_paths = reject_files_external_to_app(template_paths) unless outside_app_allowed
template_paths.map do |template|
- handler, format, variant = extract_handler_and_format_and_variant(template)
-
- FileTemplate.new(File.expand_path(template), handler,
- virtual_path: path.virtual,
- format: format,
- variant: variant,
- locals: locals
- )
+ build_template(template, path.virtual, locals)
end
end
+ def build_template(template, virtual_path, locals)
+ handler, format, variant = extract_handler_and_format_and_variant(template)
+
+ FileTemplate.new(File.expand_path(template), handler,
+ virtual_path: virtual_path,
+ format: format,
+ variant: variant,
+ locals: locals
+ )
+ end
+
def reject_files_external_to_app(files)
files.reject { |filename| !inside_path?(@path, filename) }
end
@@ -385,5 +389,9 @@ module ActionView
def self.instances
[new(""), new("/")]
end
+
+ def build_template(template, virtual_path, locals)
+ super(template, nil, locals)
+ end
end
end