aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorMark Roghelia <mark@roboshark.com>2011-05-31 18:41:20 -0400
committerMark Roghelia <mark@roboshark.com>2011-05-31 18:41:20 -0400
commitcd0320416790a865a9fdfeafcd7d192abfef2d3a (patch)
tree5ea3b27550963855b8d8d91f43f2aab5ea26bf09 /actionpack
parentb13a0ceb5f1ff52d0a1519986e04f8fe5b30c4aa (diff)
downloadrails-cd0320416790a865a9fdfeafcd7d192abfef2d3a.tar.gz
rails-cd0320416790a865a9fdfeafcd7d192abfef2d3a.tar.bz2
rails-cd0320416790a865a9fdfeafcd7d192abfef2d3a.zip
The example in the API docs incorrectly indicated that form_for would use the same default route for both new and previously persisted records. The default path given in the example would have generated a routing error for new records. form_for actually uses polymorphic_path to determine which route to use based on the state of the record. The example has been updated to reflect the method's actual behavior.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index cb1c13912a..7ed949504d 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -202,13 +202,13 @@ module ActionView
#
# is equivalent to something like:
#
- # <%= form_for @post, :as => :post, :url => post_path(@post), :html => { :class => "new_post", :id => "new_post" } do |f| %>
+ # <%= form_for @post, :as => :post, :url => posts_path, :html => { :class => "new_post", :id => "new_post" } do |f| %>
# ...
# <% end %>
#
# You can also overwrite the individual conventions, like this:
#
- # <%= form_for(@post, :url => super_post_path(@post)) do |f| %>
+ # <%= form_for(@post, :url => super_posts_path) do |f| %>
# ...
# <% end %>
#