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.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/mime_responds.rb b/actionpack/lib/action_controller/mime_responds.rb
index d492b6c258..4dad2c96d2 100644
--- a/actionpack/lib/action_controller/mime_responds.rb
+++ b/actionpack/lib/action_controller/mime_responds.rb
@@ -18,8 +18,7 @@ module ActionController #:nodoc:
DEFAULT_BLOCKS = {
:html => 'Proc.new { render }',
:js => 'Proc.new { render :action => "#{action_name}.rjs" }',
- :xml => 'Proc.new { render :action => "#{action_name}.rxml" }',
- :xml_arg => 'Proc.new { render :xml => __mime_responder_arg__ }'
+ :xml => 'Proc.new { render :action => "#{action_name}.rxml" }'
}
def initialize(block_binding)
@@ -29,7 +28,7 @@ module ActionController #:nodoc:
@responses = {}
end
- def custom(mime_type, *args, &block)
+ def custom(mime_type, &block)
mime_type = mime_type.is_a?(Mime::Type) ? mime_type : Mime::Type.lookup(mime_type.to_s)
@order << mime_type
@@ -37,19 +36,14 @@ module ActionController #:nodoc:
if block_given?
@responses[mime_type] = block
else
- if argument = args.first
- eval("__mime_responder_arg__ = #{argument.is_a?(String) ? argument.inspect : argument}", @block_binding)
- @responses[mime_type] = eval(DEFAULT_BLOCKS[(mime_type.to_sym.to_s + "_arg").to_sym], @block_binding)
- else
- @responses[mime_type] = eval(DEFAULT_BLOCKS[mime_type.to_sym], @block_binding)
- end
+ @responses[mime_type] = eval(DEFAULT_BLOCKS[mime_type.to_sym], @block_binding)
end
end
for mime_type in %w( all html js xml rss atom yaml )
eval <<-EOT
- def #{mime_type}(argument = nil, &block)
- custom(Mime::#{mime_type.upcase}, argument, &block)
+ def #{mime_type}(&block)
+ custom(Mime::#{mime_type.upcase}, &block)
end
EOT
end