From f19b60b6f7dde934451a31d291869f39364a67cf Mon Sep 17 00:00:00 2001 From: Daniel Schierbeck Date: Wed, 16 Jan 2019 11:13:48 +0100 Subject: 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. --- actionpack/lib/action_controller/metal/mime_responds.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/lib/action_controller/metal/mime_responds.rb') diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index 118da11990..bf5e7a433f 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -124,6 +124,14 @@ module ActionController #:nodoc: # # 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. # # The request variant is a specialization of the request format, like :tablet, -- cgit v1.2.3