aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/action_controller_overview.textile
diff options
context:
space:
mode:
authorJoseph Pecoraro <joepeck02@gmail.com>2009-06-01 09:42:59 -0400
committerJoseph Pecoraro <joepeck02@gmail.com>2009-06-01 09:42:59 -0400
commitc2917940f5997e824263d89f2bac7a0297fc6935 (patch)
tree584a5232bb59eea52710386cfcfb915ffc03fec7 /railties/guides/source/action_controller_overview.textile
parent67317b6104fffeee2b51b77a1088ca8ef99f6d91 (diff)
downloadrails-c2917940f5997e824263d89f2bac7a0297fc6935.tar.gz
rails-c2917940f5997e824263d89f2bac7a0297fc6935.tar.bz2
rails-c2917940f5997e824263d89f2bac7a0297fc6935.zip
Fixed XHR typo and another Application => ApplicationController typo
Diffstat (limited to 'railties/guides/source/action_controller_overview.textile')
-rw-r--r--railties/guides/source/action_controller_overview.textile4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile
index b131d0bf89..756caea5fe 100644
--- a/railties/guides/source/action_controller_overview.textile
+++ b/railties/guides/source/action_controller_overview.textile
@@ -375,7 +375,7 @@ The method simply stores an error message in the flash and redirects to the logi
In this example the filter is added to +ApplicationController+ and thus all controllers in the application inherit it. This will make everything in the application require the user to be logged in in order to use it. For obvious reasons (the user wouldn't be able to log in in the first place!), not all controllers or actions should require this. You can prevent this filter from running before particular actions with +skip_before_filter+:
<ruby>
-class LoginsController < Application
+class LoginsController < ApplicationController
skip_before_filter :require_login, :only => [:new, :create]
end
</ruby>
@@ -444,7 +444,7 @@ The Rails API documentation has "more information on using filters":http://api.r
h3. Verification
-Verifications make sure certain criteria are met in order for a controller or action to run. They can specify that a certain key (or several keys in the form of an array) is present in the +params+, +session+ or +flash+ hashes or that a certain HTTP method was used or that the request was made using +XMLHTTPRequest+ (Ajax). The default action taken when these criteria are not met is to render a 400 Bad Request response, but you can customize this by specifying a redirect URL or rendering something else and you can also add flash messages and HTTP headers to the response. It is described in the "API documentation":http://api.rubyonrails.org/classes/ActionController/Verification/ClassMethods.html as "essentially a special kind of before_filter".
+Verifications make sure certain criteria are met in order for a controller or action to run. They can specify that a certain key (or several keys in the form of an array) is present in the +params+, +session+ or +flash+ hashes or that a certain HTTP method was used or that the request was made using +XMLHttpRequest+ (Ajax). The default action taken when these criteria are not met is to render a 400 Bad Request response, but you can customize this by specifying a redirect URL or rendering something else and you can also add flash messages and HTTP headers to the response. It is described in the "API documentation":http://api.rubyonrails.org/classes/ActionController/Verification/ClassMethods.html as "essentially a special kind of before_filter".
Here's an example of using verification to make sure the user supplies a username and a password in order to log in: