diff options
author | David Lee <davidomundo@gmail.com> | 2011-05-06 14:03:55 -0700 |
---|---|---|
committer | David Lee <davidomundo@gmail.com> | 2012-02-22 08:47:10 -0800 |
commit | 002713c64568114f3754799acc0723ea0d442f7a (patch) | |
tree | bd01c3ded14a9a96b92fbb54b8e0da35a899e374 /railties/guides/source/ajax_on_rails.textile | |
parent | 66b7eb19279820b6464ad2b9e3f2efadb08f2ff2 (diff) | |
download | rails-002713c64568114f3754799acc0723ea0d442f7a.tar.gz rails-002713c64568114f3754799acc0723ea0d442f7a.tar.bz2 rails-002713c64568114f3754799acc0723ea0d442f7a.zip |
Add config.default_method_for_update to support PATCH
PATCH is the correct HTML verb to map to the #update action. The
semantics for PATCH allows for partial updates, whereas PUT requires a
complete replacement.
Changes:
* adds config.default_method_for_update you can set to :patch
* optionally use PATCH instead of PUT in resource routes and forms
* adds the #patch verb to routes to detect PATCH requests
* adds #patch? to Request
* changes documentation and comments to indicate support for PATCH
This change maintains complete backwards compatibility by keeping :put
as the default for config.default_method_for_update.
Diffstat (limited to 'railties/guides/source/ajax_on_rails.textile')
-rw-r--r-- | railties/guides/source/ajax_on_rails.textile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/guides/source/ajax_on_rails.textile b/railties/guides/source/ajax_on_rails.textile index 3a0ccfe9b2..5dbfc41e9f 100644 --- a/railties/guides/source/ajax_on_rails.textile +++ b/railties/guides/source/ajax_on_rails.textile @@ -146,7 +146,8 @@ link_to_remote "Add new item", :position => :bottom </ruby> -** *:method* Most typically you want to use a POST request when adding a remote link to your view so this is the default behavior. However, sometimes you'll want to update (PUT) or delete/destroy (DELETE) something and you can specify this with the +:method+ option. Let's see an example for a typical AJAX link for deleting an item from a list: +** *:method* Most typically you want to use a POST request when adding a remote +link to your view so this is the default behavior. However, sometimes you'll want to update (PUT/PATCH) or delete/destroy (DELETE) something and you can specify this with the +:method+ option. Let's see an example for a typical AJAX link for deleting an item from a list: <ruby> link_to_remote "Delete the item", |