Just use the vanilla mime type string, no need for fancy lookups [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5154 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 4d63e01f
......@@ -130,12 +130,12 @@ def custom(mime_type, &block)
if block_given?
@responses[mime_type] = Proc.new do
eval "response.content_type = Mime::#{mime_type.to_sym.to_s.upcase}", @block_binding
eval "response.content_type = '#{mime_type.to_s}'", @block_binding
block.call
end
else
if source = DEFAULT_BLOCKS[mime_type.to_sym]
@responses[mime_type] = eval(source, @block_binding)
@responses[mime_type] = eval(source, @block_binding)
else
raise ActionController::RenderError, "Expected a block but none was given for custom mime handler #{mime_type}"
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册