From 7ea86773a915ef8bebf1e23c3eed3a8b374d21b3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 8 Oct 2006 20:30:24 +0000 Subject: r5515@ks: jeremy | 2006-10-08 13:24:42 -0700 #6281 r5516@ks: jeremy | 2006-10-08 13:29:49 -0700 respond_to :html doesn't assume .rhtml. Closes #6281. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5232 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/mime_responds.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/mime_responds.rb b/actionpack/lib/action_controller/mime_responds.rb index 80464ffdcd..ff07c3c12e 100644 --- a/actionpack/lib/action_controller/mime_responds.rb +++ b/actionpack/lib/action_controller/mime_responds.rb @@ -108,8 +108,9 @@ module ActionController #:nodoc: class Responder #:nodoc: DEFAULT_BLOCKS = [:html, :js, :xml].inject({}) do |blocks, ext| - blocks.update ext => %(Proc.new { render :action => "\#{action_name}.r#{ext}", :content_type => Mime::#{ext.to_s.upcase} }) - end + template_extension = (ext == :html ? '' : ".r#{ext}") + blocks.update ext => %(Proc.new { render :action => "\#{action_name}#{template_extension}", :content_type => Mime::#{ext.to_s.upcase} }) + end def initialize(block_binding) @block_binding = block_binding -- cgit v1.2.3