1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added documentation for usage of associative resources with form_for

This commit is contained in:
Rizwan Reza 2010-07-01 23:07:24 +04:30
parent d167cfd62b
commit a6913bf7eb

View file

@ -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: