aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_helper.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-02-24 16:25:41 -0800
committerXavier Noria <fxn@hashref.com>2012-02-24 16:25:41 -0800
commitb7a094536de6fdeb428aa79d21f1e2128169f45e (patch)
treeec0af33cb15a1c70a3f3e71b954782068a2040dd /actionpack/lib/action_view/helpers/form_helper.rb
parent31ceb5e67b164eb98cddd5aef0bc87dad606a6bf (diff)
downloadrails-b7a094536de6fdeb428aa79d21f1e2128169f45e.tar.gz
rails-b7a094536de6fdeb428aa79d21f1e2128169f45e.tar.bz2
rails-b7a094536de6fdeb428aa79d21f1e2128169f45e.zip
uses PATCH for the forms of persisted records, and routes PATCH and PUT to the update action of resources
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 33d509d968..53ae8b66da 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -385,7 +385,7 @@ module ActionView
object = convert_to_model(object)
as = options[:as]
- action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, ActionView::Base.default_method_for_update] : [:new, :post]
+ action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, :patch] : [:new, :post]
options[:html].reverse_merge!(
:class => as ? "#{action}_#{as}" : dom_class(object, action),
:id => as ? "#{action}_#{as}" : [options[:namespace], dom_id(object, action)].compact.join("_").presence,