From 639fded77b5797b7770c99a76a40c141cc95c178 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Hirano Date: Mon, 9 Oct 2017 10:11:03 +0900 Subject: Use `form_with` instead of `form_for` in engine guide [ci skip] --- guides/source/action_controller_overview.md | 6 +++--- guides/source/engines.md | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'guides') diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md index 014559f36b..d53c4dedf9 100644 --- a/guides/source/action_controller_overview.md +++ b/guides/source/action_controller_overview.md @@ -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 %> ``` diff --git a/guides/source/engines.md b/guides/source/engines.md index 738de5d588..9f39832a7e 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -537,12 +537,12 @@ directory at `app/views/blorgh/comments` and in it a new file called ```html+erb

New comment

-<%= form_for [@article, @article.comments.build] do |f| %> +<%= form_with(model: [@article, @article.comments.build], local: true) do |form| %>

- <%= f.label :text %>
- <%= f.text_area :text %> + <%= form.label :text %>
+ <%= form.text_area :text %>

- <%= f.submit %> + <%= form.submit %> <% end %> ``` @@ -783,8 +783,8 @@ added above the `title` field with this code: ```html+erb
- <%= f.label :author_name %>
- <%= f.text_field :author_name %> + <%= form.label :author_name %>
+ <%= form.text_field :author_name %>
``` -- cgit v1.2.3