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

Fix typo in API document FormHelper#fields

- Fix typo
- Adjust output example to other example's format
This commit is contained in:
kami-zh 2018-01-25 16:58:32 +09:00
parent 057ba1280b
commit 523f296557

View file

@ -1014,14 +1014,13 @@ module ActionView
# <%= fields :comment do |fields| %>
# <%= fields.text_field :body %>
# <% end %>
# # => <input type="text" name="comment[body]>
# # => <input type="text" name="comment[body]">
#
# # Using a model infers the scope and assigns field values:
# <%= fields model: Comment.new(body: "full bodied") do |fields| %<
# <%= fields model: Comment.new(body: "full bodied") do |fields| %>
# <%= fields.text_field :body %>
# <% end %>
# # =>
# <input type="text" name="comment[body] value="full bodied">
# # => <input type="text" name="comment[body]" value="full bodied">
#
# # Using +fields+ with +form_with+:
# <%= form_with model: @post do |form| %>