未验证 提交 f19b60b6 编写于 作者: D Daniel Schierbeck 提交者: GitHub

Document that `format.any` can match all formats

I had to dig around the code to discover this, since I had a use case for the behavior.
上级 a08827a9
...@@ -124,6 +124,14 @@ module MimeResponds ...@@ -124,6 +124,14 @@ module MimeResponds
# #
# render json: @people # render json: @people
# #
# +any+ can also be used with no arguments, in which case it will be used for any format requested by
# the user:
#
# respond_to do |format|
# format.html
# format.any { redirect_to support_path }
# end
#
# Formats can have different variants. # Formats can have different variants.
# #
# The request variant is a specialization of the request format, like <tt>:tablet</tt>, # The request variant is a specialization of the request format, like <tt>:tablet</tt>,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册