aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-04-30 20:17:06 +0000
committerRick Olson <technoweenie@gmail.com>2006-04-30 20:17:06 +0000
commit59bd6586c8e7e290187978f3868d435ee267006c (patch)
treefa873956c3c6b1474cfad169bb7516a39bbba104 /actionpack/lib
parent4daf2c1ee64188095730c29f5838bbc7d3490d9d (diff)
downloadrails-59bd6586c8e7e290187978f3868d435ee267006c.tar.gz
rails-59bd6586c8e7e290187978f3868d435ee267006c.tar.bz2
rails-59bd6586c8e7e290187978f3868d435ee267006c.zip
Add Integration Session methods for PUT and DELETE requests [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4317 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/integration.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb
index 56ac4b74fe..afceffce89 100644
--- a/actionpack/lib/action_controller/integration.rb
+++ b/actionpack/lib/action_controller/integration.rb
@@ -143,17 +143,20 @@ module ActionController
# (application/x-www-form-urlencoded or multipart/form-data). The headers
# should be a hash. The keys will automatically be upcased, with the
# prefix 'HTTP_' added if needed.
+ #
+ # You can also perform POST, PUT, DELETE, and HEAD requests with #post,
+ # #put, #delete, and #head.
def get(path, parameters=nil, headers=nil)
process :get, path, parameters, headers
end
- # Performs a POST request with the given parameters. The parameters may
- # be +nil+, a Hash, or a string that is appropriately encoded
- # (application/x-www-form-urlencoded or multipart/form-data). The headers
- # should be a hash. The keys will automatically be upcased, with the
- # prefix 'HTTP_' added if needed.
- def post(path, parameters=nil, headers=nil)
- process :post, path, parameters, headers
+ # keep the docs for #get
+ %w( post put delete head ).each do |method|
+ class_eval <<-EOV, __FILE__, __LINE__
+ def #{method}(path, parameters=nil, headers=nil)
+ process :#{method}, path, parameters, headers
+ end
+ EOV
end
# Performs an XMLHttpRequest request with the given parameters, mimicing