diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-03-29 00:41:11 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-03-29 00:41:11 +0530 |
commit | 910a8d22460a8b8e67a16441dadb87cc12ab7a4a (patch) | |
tree | a0561863efa0e49b6f1982b6a39182e7750c5083 /railties/guides/source/action_controller_overview.textile | |
parent | 7b9bdd9253c7f8f3b89664ac616ff9bd5ea3ac87 (diff) | |
parent | 62dd3458e326b1f2927d43401e7b10004410fdf0 (diff) | |
download | rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.tar.gz rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.tar.bz2 rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/guides/source/action_controller_overview.textile')
-rw-r--r-- | railties/guides/source/action_controller_overview.textile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile index ecb03a48e4..178d98c2d6 100644 --- a/railties/guides/source/action_controller_overview.textile +++ b/railties/guides/source/action_controller_overview.textile @@ -816,6 +816,28 @@ end NOTE: Certain exceptions are only rescuable from the +ApplicationController+ class, as they are raised before the controller gets initialized and the action gets executed. See Pratik Naik's "article":http://m.onkey.org/2008/7/20/rescue-from-dispatching on the subject for more information. +h3. Force HTTPS protocol + +Sometime you might want to force a particular controller to only be accessible via an HTTPS protocol for security reason. Since Rails 3.1 you can now use +force_ssl+ method in your controller to enforce that: + +<ruby> +class DinnerController + force_ssl +end +</ruby> + +Just like the filter, you could also passing +:only+ and +:except+ to enforce the secure connection only to specific actions + +<ruby> +class DinnerController + force_ssl :only => :cheeseburger + # or + force_ssl :except => :cheeseburger +end +</ruby> + +Please note that if you found yourself adding +force_ssl+ to many controllers, you may found yourself wanting to force the whole application to use HTTPS instead. In that case, you can set the +config.force_ssl+ in your environment file. + h3. Changelog * February 17, 2009: Yet another proofread by Xavier Noria. |