提交 523f2965 编写于 作者: K kami-zh

Fix typo in API document FormHelper#fields

- Fix typo
- Adjust output example to other example's format
上级 057ba128
......@@ -1014,14 +1014,13 @@ def fields_for(record_name, record_object = nil, options = {}, &block)
# <%= 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| %>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册