aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-08-26 15:19:55 -0300
committerJosé Valim <jose.valim@gmail.com>2010-08-26 16:07:54 -0300
commit84cab320bc1faaddc142cbbb38713d3f29a8b07d (patch)
treef165c9c3a9d5544c194affc54382e02025cdf73c /actionpack
parentd728f0858014cf284f501f169f13d8cd1da36ab7 (diff)
downloadrails-84cab320bc1faaddc142cbbb38713d3f29a8b07d.tar.gz
rails-84cab320bc1faaddc142cbbb38713d3f29a8b07d.tar.bz2
rails-84cab320bc1faaddc142cbbb38713d3f29a8b07d.zip
Ensure templates like template.html are found but still uses the proper virtual path.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/template.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 40ff1f2182..7decec24ab 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -113,12 +113,13 @@ module ActionView
@identifier = identifier
@handler = handler
@original_encoding = nil
-
- @virtual_path = details[:virtual_path]
- @method_names = {}
+ @method_names = {}
format = details[:format] || :html
@formats = Array.wrap(format).map(&:to_sym)
+
+ @virtual_path = details[:virtual_path]
+ @virtual_path.sub!(".#{format}", "") if @virtual_path
end
def render(view, locals, &block)