aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRizwan Reza <rizwanreza@gmail.com>2010-04-05 06:45:15 +0430
committerRizwan Reza <rizwanreza@gmail.com>2010-04-05 06:45:15 +0430
commit181e4aac5236f73b2f2f86a162dc29d0a41eb915 (patch)
tree3712476c3c5ba58f786b39eb973655fbeeb86ecd /actionpack/lib
parent1a142fcd4d6928323a74b430e8d4b91e7a5f7c7a (diff)
downloadrails-181e4aac5236f73b2f2f86a162dc29d0a41eb915.tar.gz
rails-181e4aac5236f73b2f2f86a162dc29d0a41eb915.tar.bz2
rails-181e4aac5236f73b2f2f86a162dc29d0a41eb915.zip
We don't need explicit :url => { :action => "create" } in form_for when following Rails conventions.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 9467a0912a..64616f4fce 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -29,7 +29,7 @@ module ActionView
#
# # Note: a @person variable will have been created in the controller.
# # For example: @person = Person.new
- # <%= form_for :person, @person, :url => { :action => "create" } do |f| %>
+ # <%= form_for @person do |f| %>
# <%= f.text_field :first_name %>
# <%= f.text_field :last_name %>
# <%= submit_tag 'Create' %>
@@ -45,7 +45,7 @@ module ActionView
#
# If you are using a partial for your form fields, you can use this shortcut:
#
- # <%= form_for :person, @person, :url => { :action => "create" } do |f| %>
+ # <%= form_for :person, @person do |form| %>
# <%= render :partial => f %>
# <%= submit_tag 'Create' %>
# <% end %>
@@ -121,7 +121,7 @@ module ActionView
# The generic way to call +form_for+ yields a form builder around a
# model:
#
- # <%= form_for :person, :url => { :action => "create" } do |f| %>
+ # <%= form_for :person do |f| %>
# <%= f.error_messages %>
# First name: <%= f.text_field :first_name %><br />
# Last name : <%= f.text_field :last_name %><br />
@@ -145,7 +145,7 @@ module ActionView
# If the instance variable is not <tt>@person</tt> you can pass the actual
# record as the second argument:
#
- # <%= form_for :person, person, :url => { :action => "create" } do |f| %>
+ # <%= form_for :person, person do |f| %>
# ...
# <% end %>
#
@@ -177,7 +177,7 @@ module ActionView
# possible to use both the stand-alone FormHelper methods and methods
# from FormTagHelper. For example:
#
- # <%= form_for :person, @person, :url => { :action => "create" } do |f| %>
+ # <%= form_for :person, @person do |f| %>
# First name: <%= f.text_field :first_name %>
# Last name : <%= f.text_field :last_name %>
# Biography : <%= text_area :person, :biography %>
@@ -354,13 +354,13 @@ module ActionView
# ...or if you have an object that needs to be represented as a different
# parameter, like a Client that acts as a Person:
#
- # <%= fields_for :person, @client, :url => { :action => "create" } do |permission_fields| %>
+ # <%= fields_for :person, @client do |permission_fields| %>
# Admin?: <%= permission_fields.check_box :admin %>
# <% end %>
#
# ...or if you don't have an object, just a name of the parameter:
#
- # <%= fields_for :person, :url => { :action => "create" } do |permission_fields| %>
+ # <%= fields_for :person do |permission_fields| %>
# Admin?: <%= permission_fields.check_box :admin %>
# <% end %>
#