diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-25 12:37:08 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-25 12:37:08 -0500 |
commit | ccdeb43d2e06fb87c1fb84e979c4f7775e7ed105 (patch) | |
tree | 6a811e866879cb79f0db9e4a9aaf7c6b6c2989e5 /guides/source/getting_started.md | |
parent | b395265f7c9fbb94a29d0934dd329690a02861df (diff) | |
parent | 7fe5ae8d237c8f821bc5e984f98d9d7eb7c35266 (diff) | |
download | rails-ccdeb43d2e06fb87c1fb84e979c4f7775e7ed105.tar.gz rails-ccdeb43d2e06fb87c1fb84e979c4f7775e7ed105.tar.bz2 rails-ccdeb43d2e06fb87c1fb84e979c4f7775e7ed105.zip |
Merge branch 'master' into adequaterecord
* master: (28 commits)
move AR length validation tests into separate test-case.
No need for trailing slash on migration path.
reset `@arel` when modifying a Relation in place.
PostgreSQL Timestamps always map to `:datetime`.
[ci skip] Improve formatting and yml
Fix a typo in the doc of forty_two AR FinderMethod
Improve readability of contributing to rails guide. [ci skip]
Precompile the image we're referencing, too.
`ActiveRecord::Base.no_touching` no longer triggers callbacks or start empty transactions.
Fixed an issue with migrating legacy json cookies.
Correct comment [ci skip]
Perfer to define methods instead of calling test
Fix syntax error
Add CHANGELOG entry for #14757 [ci skip]
Fix run-on sentences and improve grammar [skip ci]
Add test for using ActionView::Helpers::FormHelper.label with block and html
select! renamed to avoid name collision Array#select!
Rearrange deck chairs on the titanic. Organize connection handling test cases.
Change favicon_link_tag helper mimetype from image/vnd.microsoft.icon to image/x-icon.
ActionController::Renderers documentation fix
...
Diffstat (limited to 'guides/source/getting_started.md')
-rw-r--r-- | guides/source/getting_started.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 542e402ca1..8966eef76a 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -1839,7 +1839,7 @@ database and send us back to the show action for the article. ### Deleting Associated Objects -If you delete an article then its associated comments will also need to be +If you delete an article, its associated comments will also need to be deleted. Otherwise they would simply occupy space in the database. Rails allows you to use the `dependent` option of an association to achieve this. Modify the Article model, `app/models/article.rb`, as follows: @@ -1857,21 +1857,21 @@ Security ### Basic Authentication -If you were to publish your blog online, anybody would be able to add, edit and +If you were to publish your blog online, anyone would be able to add, edit and delete articles or delete comments. Rails provides a very simple HTTP authentication system that will work nicely in this situation. -In the `ArticlesController` we need to have a way to block access to the various -actions if the person is not authenticated, here we can use the Rails -`http_basic_authenticate_with` method, allowing access to the requested +In the `ArticlesController` we need to have a way to block access to the +various actions if the person is not authenticated. Here we can use the Rails +`http_basic_authenticate_with` method, which allows access to the requested action if that method allows it. To use the authentication system, we specify it at the top of our -`ArticlesController`, in this case, we want the user to be authenticated on -every action, except for `index` and `show`, so we write that in -`app/controllers/articles_controller.rb`: +`ArticlesController` in `app/controllers/articles_controller.rb`. In our case, +we want the user to be authenticated on every action except `index` and `show`, +so we write that: ```ruby class ArticlesController < ApplicationController |