Use `form_with` instead of `form_for` in engine guide [ci skip]

This commit is contained in:
Yoshiyuki Hirano 2017-10-09 10:11:03 +09:00
parent 142831159c
commit 639fded77b
2 changed files with 9 additions and 9 deletions

View File

@ -784,9 +784,9 @@ The way this is done is to add a non-guessable token which is only known to your
If you generate a form like this: If you generate a form like this:
```erb ```erb
<%= form_for @user do |f| %> <%= form_with model: @user, local: true do |form| %>
<%= f.text_field :username %> <%= form.text_field :username %>
<%= f.text_field :password %> <%= form.text_field :password %>
<% end %> <% end %>
``` ```

View File

@ -537,12 +537,12 @@ directory at `app/views/blorgh/comments` and in it a new file called
```html+erb ```html+erb
<h3>New comment</h3> <h3>New comment</h3>
<%= form_for [@article, @article.comments.build] do |f| %> <%= form_with(model: [@article, @article.comments.build], local: true) do |form| %>
<p> <p>
<%= f.label :text %><br> <%= form.label :text %><br>
<%= f.text_area :text %> <%= form.text_area :text %>
</p> </p>
<%= f.submit %> <%= form.submit %>
<% end %> <% end %>
``` ```
@ -783,8 +783,8 @@ added above the `title` field with this code:
```html+erb ```html+erb
<div class="field"> <div class="field">
<%= f.label :author_name %><br> <%= form.label :author_name %><br>
<%= f.text_field :author_name %> <%= form.text_field :author_name %>
</div> </div>
``` ```