Skip to content

Commit

Permalink
Merge pull request #30839 from yhirano55/use_form_with_in_engine_guide
Browse files Browse the repository at this point in the history
Use `form_with` instead of `form_for` in engine guide [ci skip]
  • Loading branch information
kamipo committed Oct 9, 2017
2 parents bb5b672 + 639fded commit 992572a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions guides/source/action_controller_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```erb
<%= form_for @user do |f| %>
<%= f.text_field :username %>
<%= f.text_field :password %>
<%= form_with model: @user, local: true do |form| %>
<%= form.text_field :username %>
<%= form.text_field :password %>
<% end %>
```

Expand Down
12 changes: 6 additions & 6 deletions guides/source/engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,12 @@ directory at `app/views/blorgh/comments` and in it a new file called

```html+erb
<h3>New comment</h3>
<%= form_for [@article, @article.comments.build] do |f| %>
<%= form_with(model: [@article, @article.comments.build], local: true) do |form| %>
<p>
<%= f.label :text %><br>
<%= f.text_area :text %>
<%= form.label :text %><br>
<%= form.text_area :text %>
</p>
<%= f.submit %>
<%= form.submit %>
<% end %>
```

Expand Down Expand Up @@ -783,8 +783,8 @@ added above the `title` field with this code:

```html+erb
<div class="field">
<%= f.label :author_name %><br>
<%= f.text_field :author_name %>
<%= form.label :author_name %><br>
<%= form.text_field :author_name %>
</div>
```

Expand Down

0 comments on commit 992572a

Please sign in to comment.