aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/rails_on_rack.textile
diff options
context:
space:
mode:
authorEmili ParreƱo <emili@eparreno.com>2011-08-10 23:32:11 +0200
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:34 -0700
commit1b0d03b5db04f19d9428959844624a47f6ba1a2f (patch)
tree4935b5d8b8922f95949b67344f40690ee19d915d /railties/guides/source/rails_on_rack.textile
parent635c1ca007a4e86f277508ec5b116ebcbe71a7f2 (diff)
downloadrails-1b0d03b5db04f19d9428959844624a47f6ba1a2f.tar.gz
rails-1b0d03b5db04f19d9428959844624a47f6ba1a2f.tar.bz2
rails-1b0d03b5db04f19d9428959844624a47f6ba1a2f.zip
update rails on rack guide, section 2 needs to be changed or maybe deleted
Diffstat (limited to 'railties/guides/source/rails_on_rack.textile')
-rw-r--r--railties/guides/source/rails_on_rack.textile33
1 files changed, 21 insertions, 12 deletions
diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile
index 8d5985dba8..818df0ffaf 100644
--- a/railties/guides/source/rails_on_rack.textile
+++ b/railties/guides/source/rails_on_rack.textile
@@ -89,23 +89,32 @@ $ rake middleware
For a freshly generated Rails application, this might produce something like:
<ruby>
+use ActionDispatch::Static
use Rack::Lock
-use ActionController::Failsafe
-use ActionController::Session::CookieStore, , {:secret=>"<secret>", :session_key=>"_<app>_session"}
-use Rails::Rack::Metal
-use ActionDispatch::RewindableInput
-use ActionController::ParamsParser
-use Rack::MethodOverride
-use Rack::Head
+use ActiveSupport::Cache::Strategy::LocalCache
+use Rack::Runtime
+use Rails::Rack::Logger
+use ActionDispatch::ShowExceptions
+use ActionDispatch::RemoteIp
+use Rack::Sendfile
+use ActionDispatch::Callbacks
+use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
-run ActionController::Dispatcher.new
+use ActionDispatch::Cookies
+use ActionDispatch::Session::CookieStore
+use ActionDispatch::Flash
+use ActionDispatch::ParamsParser
+use Rack::MethodOverride
+use ActionDispatch::Head
+use ActionDispatch::BestStandardsSupport
+run Blog::Application.routes
</ruby>
Purpose of each of this middlewares is explained in the "Internal Middlewares":#internal-middleware-stack section.
h4. Configuring Middleware Stack
-Rails provides a simple configuration interface +config.middleware+ for adding, removing and modifying the middlewares in the middleware stack via +environment.rb+ or the environment specific configuration file <tt>environments/&lt;environment&gt;.rb</tt>.
+Rails provides a simple configuration interface +config.middleware+ for adding, removing and modifying the middlewares in the middleware stack via +application.rb+ or the environment specific configuration file <tt>environments/&lt;environment&gt;.rb</tt>.
h5. Adding a Middleware
@@ -118,7 +127,7 @@ You can add a new middleware to the middleware stack using any of the following
* <tt>config.middleware.insert_after(existing_middleware, new_middleware, args)</tt> - Adds the new middleware after the specified existing middleware in the middleware stack.
<ruby>
-# config/environment.rb
+# config/application.rb
# Push Rack::BounceFavicon at the bottom
config.middleware.use Rack::BounceFavicon
@@ -133,7 +142,7 @@ h5. Swapping a Middleware
You can swap an existing middleware in the middleware stack using +config.middleware.swap+.
<ruby>
-# config/environment.rb
+# config/application.rb
# Replace ActionController::Failsafe with Lifo::Failsafe
config.middleware.swap ActionController::Failsafe, Lifo::Failsafe
@@ -198,7 +207,7 @@ The following shows how to replace use +Rack::Builder+ instead of the Rails supp
<strong>Clear the existing Rails middleware stack</strong>
<ruby>
-# environment.rb
+# config/application.rb
config.middleware.clear
</ruby>