Doc fix (closes #5576)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 28ef328b
......@@ -93,7 +93,7 @@ module InstanceMethods
# in a single request (i.e., by wrapping them all in a single root note), but if you just go with the flow
# and accept Rails' defaults, life will be much easier.
def respond_to(*types, &block)
raise ArgumentError, "respond_to takes either types or a block, never bot" unless types.any? ^ block
raise ArgumentError, "respond_to takes either types or a block, never both" unless types.any? ^ block
block ||= lambda { |responder| types.each { |type| responder.send(type) } }
responder = Responder.new(block.binding)
block.call(responder)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册