diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-28 04:20:49 +0100 |
---|---|---|
committer | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-28 04:20:49 +0100 |
commit | 6f0caa1a534a065753d51430b649114bc8bf54ac (patch) | |
tree | af9657373436a38ef7828b26a804d1fe12e479ad /railties/guides/source/action_controller_overview.textile | |
parent | 726b7ede54031eecfcee34eec80040553e9ad19f (diff) | |
parent | 245542ea2994961731be105db6c076256a22a7a9 (diff) | |
download | rails-6f0caa1a534a065753d51430b649114bc8bf54ac.tar.gz rails-6f0caa1a534a065753d51430b649114bc8bf54ac.tar.bz2 rails-6f0caa1a534a065753d51430b649114bc8bf54ac.zip |
Merge branch 'master' of https://github.com/rails/rails into performance_test
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. |