diff options
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/template.rb | 7 |
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) |