aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/mime_responds.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/mime_responds.rb')
-rw-r--r--actionpack/lib/action_controller/mime_responds.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/mime_responds.rb b/actionpack/lib/action_controller/mime_responds.rb
index ff07c3c12e..e4d1dbbccc 100644
--- a/actionpack/lib/action_controller/mime_responds.rb
+++ b/actionpack/lib/action_controller/mime_responds.rb
@@ -107,10 +107,11 @@ module ActionController #:nodoc:
end
class Responder #:nodoc:
- DEFAULT_BLOCKS = [:html, :js, :xml].inject({}) do |blocks, ext|
- 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
+ default_block_format = %(Proc.new { render :action => "\#{action_name}%s", :content_type => Mime::%s })
+ DEFAULT_BLOCKS = {}
+ DEFAULT_BLOCKS[:html] = default_block_format % ['', 'HTML']
+ DEFAULT_BLOCKS[:js] = default_block_format % ['.js.rjs', 'JS']
+ DEFAULT_BLOCKS[:xml] = default_block_format % ['.xml.builder', 'XML']
def initialize(block_binding)
@block_binding = block_binding