Skip to content
This repository
Browse code

Fixed XHR typo and another Application => ApplicationController typo

  • Loading branch information...
commit c2917940f5997e824263d89f2bac7a0297fc6935 1 parent 67317b6
Joseph Pecoraro JosephPecoraro authored
4 railties/guides/source/action_controller_overview.textile
Source Rendered
@@ -375,7 +375,7 @@ The method simply stores an error message in the flash and redirects to the logi
375 375 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+:
376 376
377 377 <ruby>
378   -class LoginsController < Application
  378 +class LoginsController < ApplicationController
379 379 skip_before_filter :require_login, :only => [:new, :create]
380 380 end
381 381 </ruby>
@@ -444,7 +444,7 @@ The Rails API documentation has "more information on using filters":http://api.r
444 444
445 445 h3. Verification
446 446
447   -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".
  447 +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".
448 448
449 449 Here's an example of using verification to make sure the user supplies a username and a password in order to log in:
450 450

0 comments on commit c291794

Please sign in to comment.
Something went wrong with that request. Please try again.