aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/working_with_javascript_in_rails.md
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2017-04-27 15:13:24 +0200
committerRobin Dupret <robin.dupret@gmail.com>2017-04-27 15:13:24 +0200
commit1cbf4b17198ede59f7e188ca79ad1bb8dad7dfe1 (patch)
treec168677b5e57f56e92c802e03b87f728627e8731 /guides/source/working_with_javascript_in_rails.md
parent6ceb7ce162296c1813e95b6a2a68735519028c90 (diff)
downloadrails-1cbf4b17198ede59f7e188ca79ad1bb8dad7dfe1.tar.gz
rails-1cbf4b17198ede59f7e188ca79ad1bb8dad7dfe1.tar.bz2
rails-1cbf4b17198ede59f7e188ca79ad1bb8dad7dfe1.zip
Nest Action View remote helpers one level deeper [ci skip]
Diffstat (limited to 'guides/source/working_with_javascript_in_rails.md')
-rw-r--r--guides/source/working_with_javascript_in_rails.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md
index 45dfeee19e..544c04f768 100644
--- a/guides/source/working_with_javascript_in_rails.md
+++ b/guides/source/working_with_javascript_in_rails.md
@@ -141,6 +141,8 @@ follow this pattern.
Built-in Helpers
----------------------
+### Remote elements
+
Rails provides a bunch of view helper methods written in Ruby to assist you
in generating HTML. Sometimes, you want to add a little Ajax to those elements,
and Rails has got your back in those cases.
@@ -156,7 +158,7 @@ tags to your DOM.
You can read below about the different events that are fired dealing with
remote elements inside your application.
-### form_with
+#### form_with
[`form_with`](http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_with)
is a helper that assists with writing forms. By default, `form_with` considers
@@ -195,7 +197,7 @@ $(document).ready ->
Obviously, you'll want to be a bit more sophisticated than that, but it's a
start. You can see more about the events [in the jquery-ujs wiki](https://github.com/rails/jquery-ujs/wiki/ajax).
-### link_to
+#### link_to
[`link_to`](http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to)
is a helper that assists with generating links. It has a `:remote` option you
@@ -227,7 +229,7 @@ $ ->
alert "The article was deleted."
```
-### button_to
+#### button_to
[`button_to`](http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to) is a helper that helps you create buttons. It has a `:remote` option that you can call like this: