aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/working_with_javascript_in_rails.md
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source/working_with_javascript_in_rails.md')
-rw-r--r--guides/source/working_with_javascript_in_rails.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md
index 527b244b0d..9af1c5438c 100644
--- a/guides/source/working_with_javascript_in_rails.md
+++ b/guides/source/working_with_javascript_in_rails.md
@@ -213,7 +213,7 @@ which generates
<a href="/articles/1" data-remote="true">an article</a>
```
-You can bind to the same Ajax events as `form_for`. Here's an example. Let's
+You can bind to the same Ajax events as `form_with`. Here's an example. Let's
assume that we have a list of articles that can be deleted with just one
click. We would generate some HTML like this:
@@ -245,7 +245,7 @@ this generates
</form>
```
-Since it's just a `<form>`, all of the information on `form_for` also applies.
+Since it's just a `<form>`, all of the information on `form_with` also applies.
### Customize remote elements
@@ -301,7 +301,7 @@ on forms will trigger it on submit. For example:
```erb
<%= link_to "Dangerous zone", dangerous_zone_path,
- data: { confirm: 'Are you sure?'} %>
+ data: { confirm: 'Are you sure?' } %>
```
This generates:
@@ -333,7 +333,7 @@ For example:
```erb
<%= form_with(model: @article.new) do |f| %>
- <%= f.submit data: { "disable-with": "Saving..."} %>
+ <%= f.submit data: { "disable-with": "Saving..." } %>
<%= end %>
```
@@ -409,7 +409,7 @@ The index view (`app/views/users/index.html.erb`) contains:
<br>
-<%= form_for(@user, remote: true) do |f| %>
+<%= form_with(model: @user) do |f| %>
<%= f.label :name %><br>
<%= f.text_field :name %>
<%= f.submit %>