aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorCharlie Jonas <charlie@charliejonas.co.uk>2019-02-10 20:46:52 +0000
committerGitHub <noreply@github.com>2019-02-10 20:46:52 +0000
commit768a081751482a3e09d7051e205b39fcb97492d2 (patch)
tree06021e9879614a9bac3b60f9377374e04d319e47 /guides
parent38f9e41f2c4b64377ffb036c53873dbfb51546cf (diff)
downloadrails-768a081751482a3e09d7051e205b39fcb97492d2.tar.gz
rails-768a081751482a3e09d7051e205b39fcb97492d2.tar.bz2
rails-768a081751482a3e09d7051e205b39fcb97492d2.zip
Correct JavaScript example in guide [ci skip]
Swap `#users` jQuery selector to correct position and prevent the escaping of HTML.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/working_with_javascript_in_rails.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md
index c36b3faa6c..3f00c71596 100644
--- a/guides/source/working_with_javascript_in_rails.md
+++ b/guides/source/working_with_javascript_in_rails.md
@@ -475,7 +475,7 @@ respond to your Ajax request. You then have a corresponding
code that will be sent and executed on the client side.
```erb
-$("<%= escape_javascript(render @user) %>").appendTo("#users");
+$("#users").appendTo("<%= raw escape_javascript(render @user) %>");
```
Turbolinks