Browse files

added CSRF helper to rails guide documentation. Closes #11615. [ci skip]

  • Loading branch information...
1 parent 62e8145 commit 2883cb97663ec4cc41932d4e8d0878af96262372 @senny senny committed Mar 8, 2014
Showing with 19 additions and 3 deletions.
  1. +19 −3 guides/source/
@@ -1550,7 +1550,7 @@ end
Sanitizes a block of CSS code.
-#### strip_links(html)
+#### strip_links(html)
Strips all link tags from text leaving just the link text.
@@ -1568,9 +1568,9 @@ strip_links('Blog: <a href="">Visit</a>.')
# => Blog: Visit.
-#### strip_tags(html)
+#### strip_tags(html)
-Strips all HTML tags from the html, including comments.
+Strips all HTML tags from the html, including comments.
This uses the html-scanner tokenizer and so its HTML parsing ability is limited by that of html-scanner.
@@ -1585,6 +1585,22 @@ strip_tags("<b>Bold</b> no more! <a href='more.html'>See more</a>")
NB: The output may still contain unescaped '<', '>', '&' characters and confuse browsers.
+### CsrfHelper
+Returns meta tags "csrf-param" and "csrf-token" with the name of the cross-site
+request forgery protection parameter and token, respectively.
+ <%= csrf_meta_tags %>
+These are used to generate the dynamic forms that implement non-remote links
+with `:method`.
+Note that regular forms generate hidden fields, and that Ajax calls are
+whitelisted, so they do not use these tags.
+More details can be found in the [Rails Security Guide](security.html).
Localized Views

0 comments on commit 2883cb9

Please sign in to comment.