From c12fbae9322ff0afb8556bee13f3c78f68b114e0 Mon Sep 17 00:00:00 2001 From: Robert Evans Date: Wed, 5 Nov 2014 20:36:45 -0800 Subject: [PATCH] Removed documentation that still mentioned using respond_with in place of respond_to. respond_with was moved into the responders gem and deprecated inside rails, so there is no need to mention it within rails itself. --- .../action_controller/metal/mime_responds.rb | 20 ++++--------------- .../lib/action_controller/metal/renderers.rb | 3 +-- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index 591f881a53..ac1f209232 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -135,18 +135,6 @@ def respond_with(*) # # render json: @people # - # Since this is a common pattern, you can use the class method respond_to - # with the respond_with method to have the same results: - # - # class PeopleController < ApplicationController - # respond_to :html, :xml, :json - # - # def index - # @people = Person.all - # respond_with(@people) - # end - # end - # # Formats can have different variants. # # The request variant is a specialization of the request format, like :tablet, @@ -214,8 +202,8 @@ def respond_with(*) # format.html.phone # this gets rendered # end # - # Be sure to check the documentation of +respond_with+ and - # ActionController::MimeResponds.respond_to for more examples. + # Be sure to check the documentation of ActionController::MimeResponds.respond_to + # for more examples. def respond_to(*mimes) raise ArgumentError, "respond_to takes either types or a block, never both" if mimes.any? && block_given? @@ -234,8 +222,8 @@ def respond_to(*mimes) # A container for responses available from the current controller for # requests for different mime-types sent to a particular action. # - # The public controller methods +respond_with+ and +respond_to+ may be called - # with a block that is used to define responses to different mime-types, e.g. + # The public controller methods +respond_to+ may be called with a block + # that is used to define responses to different mime-types, e.g. # for +respond_to+ : # # respond_to do |format| diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index bc94536c8c..45d3962494 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -86,8 +86,7 @@ def self._render_with_renderer_method_name(key) # end # end # To use renderers and their mime types in more concise ways, see - # ActionController::MimeResponds::ClassMethods.respond_to and - # ActionController::MimeResponds#respond_with + # ActionController::MimeResponds::ClassMethods.respond_to def self.add(key, &block) define_method(_render_with_renderer_method_name(key), &block) RENDERERS << key.to_sym -- GitLab