aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/security.md
diff options
context:
space:
mode:
authorYaroslav Markin <yaroslav@markin.net>2018-04-17 18:05:12 +0300
committerYaroslav Markin <yaroslav@markin.net>2018-04-17 22:50:33 +0300
commit47013a7126a92e1f2890b68e0fd2e7ba1b77c97c (patch)
tree5937c8dc7c20e8d620b9f12f89bcb6f4a152bea7 /guides/source/security.md
parent15d7fb90cc9e783b4b925246f22d4c41c7fc447b (diff)
downloadrails-47013a7126a92e1f2890b68e0fd2e7ba1b77c97c.tar.gz
rails-47013a7126a92e1f2890b68e0fd2e7ba1b77c97c.tar.bz2
rails-47013a7126a92e1f2890b68e0fd2e7ba1b77c97c.zip
Add the `nonce: true` option for `javascript_include_tag` helper.
Diffstat (limited to 'guides/source/security.md')
-rw-r--r--guides/source/security.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/guides/source/security.md b/guides/source/security.md
index a21526d895..3ac50fb147 100644
--- a/guides/source/security.md
+++ b/guides/source/security.md
@@ -1182,6 +1182,12 @@ as part of `html_options`. Example:
<% end -%>
```
+The same works with `javascript_include_tag`:
+
+```html+erb
+<%= javascript_include_tag "script", nonce: true %>
+```
+
Use [`csp_meta_tag`](http://api.rubyonrails.org/classes/ActionView/Helpers/CspHelper.html#method-i-csp_meta_tag)
helper to create a meta tag "csp-nonce" with the per-session nonce value
for allowing inline `<script>` tags.