From 768a081751482a3e09d7051e205b39fcb97492d2 Mon Sep 17 00:00:00 2001 From: Charlie Jonas Date: Sun, 10 Feb 2019 20:46:52 +0000 Subject: Correct JavaScript example in guide [ci skip] Swap `#users` jQuery selector to correct position and prevent the escaping of HTML. --- guides/source/working_with_javascript_in_rails.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/working_with_javascript_in_rails.md') 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 -- cgit v1.2.3