aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/mime_responds.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-09-03 23:28:54 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-09-03 23:28:54 +0000
commit8ca3f34db18d23ff26ee71f11a2eba3dcfdff22f (patch)
treed45d34102bc90baf83bbe34bdb4b3d7fa00b9ce2 /actionpack/lib/action_controller/mime_responds.rb
parent6d88a992b5e92c09527c7915a7e2c8da09acb95e (diff)
downloadrails-8ca3f34db18d23ff26ee71f11a2eba3dcfdff22f.tar.gz
rails-8ca3f34db18d23ff26ee71f11a2eba3dcfdff22f.tar.bz2
rails-8ca3f34db18d23ff26ee71f11a2eba3dcfdff22f.zip
Docs and deprecation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4953 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/mime_responds.rb')
-rw-r--r--actionpack/lib/action_controller/mime_responds.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/mime_responds.rb b/actionpack/lib/action_controller/mime_responds.rb
index 21905b26c8..07bbbb4732 100644
--- a/actionpack/lib/action_controller/mime_responds.rb
+++ b/actionpack/lib/action_controller/mime_responds.rb
@@ -8,13 +8,13 @@ module ActionController #:nodoc:
# Without web-service support, an action which collects the data for displaying a list of people
# might look something like this:
#
- # def list
+ # def index
# @people = Person.find(:all)
# end
#
# Here's the same action, with web-service support baked in:
#
- # def list
+ # def index
# @people = Person.find(:all)
#
# respond_to do |format|
@@ -30,7 +30,7 @@ module ActionController #:nodoc:
# Supposing you have an action that adds a new person, optionally creating their company
# (by name) if it does not already exist, without web-services, it might look like this:
#
- # def add
+ # def create
# @company = Company.find_or_create_by_name(params[:company][:name])
# @person = @company.people.create(params[:person])
#
@@ -39,7 +39,7 @@ module ActionController #:nodoc:
#
# Here's the same action, with web-service support baked in:
#
- # def add
+ # def create
# company = params[:person].delete(:company)
# @company = Company.find_or_create_by_name(company[:name])
# @person = @company.people.create(params[:person])
@@ -97,7 +97,6 @@ module ActionController #:nodoc:
# environment.rb as follows.
#
# Mime::Type.register "image/jpg", :jpg
- #
def respond_to(*types, &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) } }