From 3b4e7c9f8e38bdc7517e85c413f48f5aadf17eec Mon Sep 17 00:00:00 2001 From: "Mr. Wolfe" Date: Wed, 10 Aug 2011 23:22:16 +0200 Subject: update rails on rack guide, section 2 needs to be changed or maybe deleted --- railties/guides/source/rails_on_rack.textile | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'railties/guides/source/rails_on_rack.textile') diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile index 8d5985dba8..ea26334ba0 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: +use ActionDispatch::Static use Rack::Lock -use ActionController::Failsafe -use ActionController::Session::CookieStore, , {:secret=>"", :session_key=>"__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 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 environments/<environment>.rb. +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 environments/<environment>.rb. h5. Adding a Middleware @@ -118,7 +127,7 @@ You can add a new middleware to the middleware stack using any of the following * config.middleware.insert_after(existing_middleware, new_middleware, args) - Adds the new middleware after the specified existing middleware in the middleware stack. -# 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+. -# 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 Clear the existing Rails middleware stack -# environment.rb +# application.rb config.middleware.clear -- cgit v1.2.3 From 635c1ca007a4e86f277508ec5b116ebcbe71a7f2 Mon Sep 17 00:00:00 2001 From: "Mr. Wolfe" Date: Wed, 10 Aug 2011 23:27:00 +0200 Subject: Revert "update rails on rack guide, section 2 needs to be changed or maybe deleted" This reverts commit 7a4e545eccf834cb620df0f909ef3f4bec4e6608. --- railties/guides/source/rails_on_rack.textile | 33 ++++++++++------------------ 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'railties/guides/source/rails_on_rack.textile') diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile index ea26334ba0..8d5985dba8 100644 --- a/railties/guides/source/rails_on_rack.textile +++ b/railties/guides/source/rails_on_rack.textile @@ -89,32 +89,23 @@ $ rake middleware For a freshly generated Rails application, this might produce something like: -use ActionDispatch::Static use Rack::Lock -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 -use ActionDispatch::Cookies -use ActionDispatch::Session::CookieStore -use ActionDispatch::Flash -use ActionDispatch::ParamsParser +use ActionController::Failsafe +use ActionController::Session::CookieStore, , {:secret=>"", :session_key=>"__session"} +use Rails::Rack::Metal +use ActionDispatch::RewindableInput +use ActionController::ParamsParser use Rack::MethodOverride -use ActionDispatch::Head -use ActionDispatch::BestStandardsSupport -run Blog::Application.routes +use Rack::Head +use ActiveRecord::QueryCache +run ActionController::Dispatcher.new 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 +application.rb+ or the environment specific configuration file environments/<environment>.rb. +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 environments/<environment>.rb. h5. Adding a Middleware @@ -127,7 +118,7 @@ You can add a new middleware to the middleware stack using any of the following * config.middleware.insert_after(existing_middleware, new_middleware, args) - Adds the new middleware after the specified existing middleware in the middleware stack. -# config/application.rb +# config/environment.rb # Push Rack::BounceFavicon at the bottom config.middleware.use Rack::BounceFavicon @@ -142,7 +133,7 @@ h5. Swapping a Middleware You can swap an existing middleware in the middleware stack using +config.middleware.swap+. -# config/application.rb +# config/environment.rb # Replace ActionController::Failsafe with Lifo::Failsafe config.middleware.swap ActionController::Failsafe, Lifo::Failsafe @@ -207,7 +198,7 @@ The following shows how to replace use +Rack::Builder+ instead of the Rails supp Clear the existing Rails middleware stack -# application.rb +# environment.rb config.middleware.clear -- cgit v1.2.3 From 1b0d03b5db04f19d9428959844624a47f6ba1a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emili=20Parre=C3=B1o?= Date: Wed, 10 Aug 2011 23:32:11 +0200 Subject: update rails on rack guide, section 2 needs to be changed or maybe deleted --- railties/guides/source/rails_on_rack.textile | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'railties/guides/source/rails_on_rack.textile') 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: +use ActionDispatch::Static use Rack::Lock -use ActionController::Failsafe -use ActionController::Session::CookieStore, , {:secret=>"", :session_key=>"__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 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 environments/<environment>.rb. +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 environments/<environment>.rb. h5. Adding a Middleware @@ -118,7 +127,7 @@ You can add a new middleware to the middleware stack using any of the following * config.middleware.insert_after(existing_middleware, new_middleware, args) - Adds the new middleware after the specified existing middleware in the middleware stack. -# 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+. -# 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 Clear the existing Rails middleware stack -# environment.rb +# config/application.rb config.middleware.clear -- cgit v1.2.3 From 317ad8cb62d10f77cf0692f0a123b4a3358629a5 Mon Sep 17 00:00:00 2001 From: Mike Gunderloy Date: Tue, 13 Sep 2011 06:47:13 -0500 Subject: Fix typo --- railties/guides/source/rails_on_rack.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source/rails_on_rack.textile') diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile index 818df0ffaf..735438b155 100644 --- a/railties/guides/source/rails_on_rack.textile +++ b/railties/guides/source/rails_on_rack.textile @@ -216,7 +216,7 @@ config.middleware.clear # config.ru -use MyOwnStackFromStratch +use MyOwnStackFromScratch run ActionController::Dispatcher.new -- cgit v1.2.3 From 9980f46ca2d250d1d3e2fac84c5dc9ca6cbab1ea Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Thu, 15 Sep 2011 00:13:29 +0530 Subject: No more changelogs inside guides --- railties/guides/source/rails_on_rack.textile | 5 ----- 1 file changed, 5 deletions(-) (limited to 'railties/guides/source/rails_on_rack.textile') diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile index 735438b155..57c03b54dc 100644 --- a/railties/guides/source/rails_on_rack.textile +++ b/railties/guides/source/rails_on_rack.textile @@ -232,8 +232,3 @@ h4. Learning Rack h4. Understanding Middlewares * "Railscast on Rack Middlewares":http://railscasts.com/episodes/151-rack-middleware - -h3. Changelog - -* February 7, 2009: Second version by "Pratik":credits.html#lifo -* January 11, 2009: First version by "Pratik":credits.html#lifo -- cgit v1.2.3 From 2b04c2f66e3cf5abbbf118eaa1e692b9e1380e4e Mon Sep 17 00:00:00 2001 From: Brian Durand Date: Fri, 21 Oct 2011 13:13:29 -0500 Subject: Add ActionDispatch::Session::CacheStore as a generic way of storing sessions in a cache. --- railties/guides/source/rails_on_rack.textile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'railties/guides/source/rails_on_rack.textile') diff --git a/railties/guides/source/rails_on_rack.textile b/railties/guides/source/rails_on_rack.textile index 57c03b54dc..d6cbd84b1f 100644 --- a/railties/guides/source/rails_on_rack.textile +++ b/railties/guides/source/rails_on_rack.textile @@ -166,8 +166,9 @@ Much of Action Controller's functionality is implemented as Middlewares. The fol |+Rack::Lock+|Sets env["rack.multithread"] flag to +true+ and wraps the application within a Mutex.| |+ActionController::Failsafe+|Returns HTTP Status +500+ to the client if an exception gets raised while dispatching.| |+ActiveRecord::QueryCache+|Enables the Active Record query cache.| -|+ActionController::Session::CookieStore+|Uses the cookie based session store.| -|+ActionController::Session::MemCacheStore+|Uses the memcached based session store.| +|+ActionDispatch::Session::CookieStore+|Uses the cookie based session store.| +|+ActionDispatch::Session::CacheStore+|Uses the Rails cache based session store.| +|+ActionDispatch::Session::MemCacheStore+|Uses the memcached based session store.| |+ActiveRecord::SessionStore+|Uses the database based session store.| |+Rack::MethodOverride+|Sets HTTP method based on +_method+ parameter or env["HTTP_X_HTTP_METHOD_OVERRIDE"].| |+Rack::Head+|Discards the response body if the client sends a +HEAD+ request.| -- cgit v1.2.3