From c819c131f2d08a8c9089a6ef0dcadcf912e2538c Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Mon, 26 Jul 2010 16:59:22 +0200 Subject: doc: cleanup respond_to documentation Signed-off-by: Wincent Colaiuta --- .../lib/action_controller/metal/mime_responds.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index c12e5797ae..c6d4c6d936 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -12,27 +12,30 @@ module ActionController #:nodoc: end module ClassMethods - # Defines mimes that are rendered by default when invoking respond_with. + # Defines mime types that are rendered by default when invoking + # respond_with. # # Examples: # # respond_to :html, :xml, :json # - # All actions on your controller will respond to :html, :xml and :json. + # Specifies that all actions in the controller respond to requests + # for :html, :xml and :json. # - # But if you want to specify it based on your actions, you can use only and - # except: + # To specify on per-action basis, use :only and + # :except with an array of actions or a single action: # # respond_to :html # respond_to :xml, :json, :except => [ :edit ] # - # The definition above explicits that all actions respond to :html. And all - # actions except :edit respond to :xml and :json. - # - # You can specify also only parameters: + # This specifies that all actions respond to :html + # and all actions except :edit respond to :xml and + # :json. # # respond_to :rjs, :only => :create # + # This specifies that the :create action and no other responds + # to :rjs. def respond_to(*mimes) options = mimes.extract_options! @@ -49,7 +52,7 @@ module ActionController #:nodoc: self.mimes_for_respond_to = new.freeze end - # Clear all mimes in respond_to. + # Clear all mime types in respond_to. # def clear_respond_to self.mimes_for_respond_to = ActiveSupport::OrderedHash.new.freeze -- cgit v1.2.3