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

Merge pull request #33898 from tkoyama1988/form_helpers_readable

Improve readability in form helpers guide [ci skip]
This commit is contained in:
Ryuta Kamizono 2018-09-17 17:42:00 +09:00 committed by GitHub
commit 7931951ccd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -775,7 +775,7 @@ You might want to render a form with a set of edit fields for each of a person's
<%= form_with model: @person do |person_form| %>
<%= person_form.text_field :name %>
<% @person.addresses.each do |address| %>
<%= person_form.fields_for address, index: address.id do |address_form|%>
<%= person_form.fields_for address, index: address.id do |address_form| %>
<%= address_form.text_field :city %>
<% end %>
<% end %>
@ -972,7 +972,7 @@ This form allows users to remove addresses:
<ul>
<%= f.fields_for :addresses do |addresses_form| %>
<li>
<%= addresses_form.check_box :_destroy%>
<%= addresses_form.check_box :_destroy %>
<%= addresses_form.label :kind %>
<%= addresses_form.text_field :kind %>
...