From 374dca2d66d474ba3434bd67e9a20e4388b2a83e Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Mon, 10 Apr 2017 11:04:38 -0400 Subject: Small grammar fixes [ci skip] --- guides/source/rails_on_rack.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'guides/source/rails_on_rack.md') diff --git a/guides/source/rails_on_rack.md b/guides/source/rails_on_rack.md index 340933c7ee..ed9c4bb72a 100644 --- a/guides/source/rails_on_rack.md +++ b/guides/source/rails_on_rack.md @@ -22,7 +22,9 @@ Rack provides a minimal, modular and adaptable interface for developing web appl * [Rack API Documentation](http://rack.github.io/) -Explaining Rack is not really in the scope of this guide. In case you are not familiar with Rack's basics, you should check out the [Resources](#resources) section below. +Explaining how Rack works is not really in the scope of this guide. In case you +are not familiar with Rack's basics, you should check out the [Resources](#resources) +section below. Rails on Rack ------------- @@ -74,7 +76,7 @@ And start the server: $ rackup config.ru ``` -To find out more about different `rackup` options: +To find out more about different `rackup` options, you can run: ```bash $ rackup --help @@ -89,7 +91,8 @@ Action Dispatcher Middleware Stack Many of Action Dispatcher's internal components are implemented as Rack middlewares. `Rails::Application` uses `ActionDispatch::MiddlewareStack` to combine various internal and external middlewares to form a complete Rails Rack application. -NOTE: `ActionDispatch::MiddlewareStack` is Rails equivalent of `Rack::Builder`, but built for better flexibility and more features to meet Rails' requirements. +NOTE: `ActionDispatch::MiddlewareStack` is Rails' equivalent of `Rack::Builder`, +but is built for better flexibility and more features to meet Rails' requirements. ### Inspecting Middleware Stack -- cgit v1.2.3 From c134a17b3d740ab1578cdd8da8aba3909910feb2 Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Mon, 10 Apr 2017 11:05:05 -0400 Subject: Remove link to rack.github.io We mention the "resources" section of the guide in the next paragraph, and the link is listed there. IMHO we shouldn't list it twice. [ci skip] --- guides/source/rails_on_rack.md | 2 -- 1 file changed, 2 deletions(-) (limited to 'guides/source/rails_on_rack.md') diff --git a/guides/source/rails_on_rack.md b/guides/source/rails_on_rack.md index ed9c4bb72a..f25b185fb5 100644 --- a/guides/source/rails_on_rack.md +++ b/guides/source/rails_on_rack.md @@ -20,8 +20,6 @@ Introduction to Rack Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call. -* [Rack API Documentation](http://rack.github.io/) - Explaining how Rack works is not really in the scope of this guide. In case you are not familiar with Rack's basics, you should check out the [Resources](#resources) section below. -- cgit v1.2.3 From 99209b4ec06b2f87b28de5bd7d02b6ed815994e6 Mon Sep 17 00:00:00 2001 From: Mike Gunderloy Date: Sat, 20 May 2017 09:30:51 -0500 Subject: Update 'Rails on Rack' guide [ci skip] * Adjust middlewares list to match current defaults * application.routes runs on application object, not Rails * Add explanation of Sprockets::Rails::QuietAssets --- guides/source/rails_on_rack.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'guides/source/rails_on_rack.md') diff --git a/guides/source/rails_on_rack.md b/guides/source/rails_on_rack.md index f25b185fb5..cef8450ee4 100644 --- a/guides/source/rails_on_rack.md +++ b/guides/source/rails_on_rack.md @@ -110,11 +110,12 @@ use ActiveSupport::Cache::Strategy::LocalCache::Middleware use Rack::Runtime use Rack::MethodOverride use ActionDispatch::RequestId +use ActionDispatch::RemoteIp +use Sprockets::Rails::QuietAssets use Rails::Rack::Logger use ActionDispatch::ShowExceptions use WebConsole::Middleware use ActionDispatch::DebugExceptions -use ActionDispatch::RemoteIp use ActionDispatch::Reloader use ActionDispatch::Callbacks use ActiveRecord::Migration::CheckPending @@ -124,7 +125,7 @@ use ActionDispatch::Flash use Rack::Head use Rack::ConditionalGet use Rack::ETag -run Rails.application.routes +run MyApp.application.routes ``` The default middlewares shown here (and some others) are each summarized in the [Internal Middlewares](#internal-middleware-stack) section, below. @@ -238,6 +239,14 @@ Much of Action Controller's functionality is implemented as Middlewares. The fol * Makes a unique `X-Request-Id` header available to the response and enables the `ActionDispatch::Request#request_id` method. +**`ActionDispatch::RemoteIp`** + +* Checks for IP spoofing attacks. + +**`Sprockets::Rails::QuietAssets`** + +* Suppresses logger output for asset requests. + **`Rails::Rack::Logger`** * Notifies the logs that the request has began. After request is complete, flushes all the logs. @@ -250,10 +259,6 @@ Much of Action Controller's functionality is implemented as Middlewares. The fol * Responsible for logging exceptions and showing a debugging page in case the request is local. -**`ActionDispatch::RemoteIp`** - -* Checks for IP spoofing attacks. - **`ActionDispatch::Reloader`** * Provides prepare and cleanup callbacks, intended to assist with code reloading during development. -- cgit v1.2.3