aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2014-12-22 17:04:26 -0700
committerSean Griffin <sean@seantheprogrammer.com>2014-12-22 17:04:26 -0700
commit8259d795606e3f3333537baadf0d1a37c4fd4fd0 (patch)
tree69a9b36adacf768598178da5b349e4b8376845e8 /guides
parentbe2b98b4ae3397149b713b774e415143c88c4fb7 (diff)
parent024edd365bcb21dee6775b196df98d16381073de (diff)
downloadrails-8259d795606e3f3333537baadf0d1a37c4fd4fd0.tar.gz
rails-8259d795606e3f3333537baadf0d1a37c4fd4fd0.tar.bz2
rails-8259d795606e3f3333537baadf0d1a37c4fd4fd0.zip
Merge pull request #18147 from andreynering/guides-line-breaks-fix
Do not use line breaks on notes [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_querying.md8
-rw-r--r--guides/source/security.md7
2 files changed, 3 insertions, 12 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index 2e7bb74d0b..a3d7916fc8 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -1382,16 +1382,12 @@ WHERE people.name = 'John'
LIMIT 1
```
-NOTE: Remember that, if `find_by` return more than one registry, it will take just the first
-and ignore the others. Note the `LIMIT 1` statement above.
+NOTE: Remember that, if `find_by` return more than one registry, it will take just the first and ignore the others. Note the `LIMIT 1` statement above.
Find or Build a New Object
--------------------------
-NOTE: Some dynamic finders were deprecated in Rails 4.0 and
-removed in Rails 4.1. The best practice is to use Active Record scopes
-instead. You can find the deprecation gem at
-https://github.com/rails/activerecord-deprecated_finders
+NOTE: Some dynamic finders were deprecated in Rails 4.0 and removed in Rails 4.1. The best practice is to use Active Record scopes instead. You can find the deprecation gem at https://github.com/rails/activerecord-deprecated_finders
It's common that you need to find a record or create it if it doesn't exist. You can do that with the `find_or_create_by` and `find_or_create_by!` methods.
diff --git a/guides/source/security.md b/guides/source/security.md
index 66c740f1e3..ca3406a086 100644
--- a/guides/source/security.md
+++ b/guides/source/security.md
@@ -247,12 +247,7 @@ protect_from_forgery with: :exception
This will automatically include a security token in all forms and Ajax requests generated by Rails. If the security token doesn't match what was expected, an exception will be thrown.
-NOTE: By default, Rails includes jQuery and an [unobtrusive scripting adapter for jQuery](https://github.com/rails/jquery-ujs),
-which adds a header called `X-CSRF-Token` on every non-GET Ajax call made by jQuery with the security token.
-Without this header, your non-GET requests won't be accepted by Rails. If you want to use another library
-to make Ajax calls, you will have to find how add the security token as a default header for Ajax calls in
-your library. To get the token have a look at the `<meta name='csrf-token' content='THE-TOKEN'>` tag printed
-by `<%= csrf_meta_tags %>` in your application view.
+NOTE: By default, Rails includes jQuery and an [unobtrusive scripting adapter for jQuery](https://github.com/rails/jquery-ujs), which adds a header called `X-CSRF-Token` on every non-GET Ajax call made by jQuery with the security token. Without this header, non-GET Ajax requests won't be accepted by Rails. When using another library to make Ajax calls, it is necessary to add the security token as a default header for Ajax calls in your library. To get the token, have a look at `<meta name='csrf-token' content='THE-TOKEN'>` tag printed by `<%= csrf_meta_tags %>` in your application view.
It is common to use persistent cookies to store user information, with `cookies.permanent` for example. In this case, the cookies will not be cleared and the out of the box CSRF protection will not be effective. If you are using a different cookie store than the session for this information, you must handle what to do with it yourself: