aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index d1b10a9281..6302491c2a 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -213,12 +213,22 @@ module ActionView
# ...
# <% end %>
#
- # And for namespaced routes, like +admin_post_url+:
+ # For namespaced routes, like +admin_post_url+:
#
# <%= form_for([:admin, @post]) do |f| %>
# ...
# <% end %>
#
+ # If your resource has associations defined, for example, you want to add comments
+ # to the post given that the routes are set correctly:
+ #
+ # <%= form_for([@document, @comment]) do |f| %>
+ # ...
+ # <% end %>
+ #
+ # Where +@document = Document.find(params[:id])+ and
+ # +@comment = Comment.new+.
+ #
# === Unobtrusive JavaScript
#
# Specifying: