diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-05-24 13:17:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-24 13:17:40 -0400 |
commit | 5cec1c9ac309e587ea5652a321d279b230a369d5 (patch) | |
tree | 84504c60c2ab4bdbeccff104f31d030f6b839771 /guides | |
parent | e03bc4a8b4cc02b034e65593f95a0fcfa5b91095 (diff) | |
parent | ea37cb4cb456d2d2feb5b582f0efd53b80e8e5cd (diff) | |
download | rails-5cec1c9ac309e587ea5652a321d279b230a369d5.tar.gz rails-5cec1c9ac309e587ea5652a321d279b230a369d5.tar.bz2 rails-5cec1c9ac309e587ea5652a321d279b230a369d5.zip |
Merge pull request #29169 from ffmike/api-guide-edit
Update Rails API Application guide to match current code [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/api_app.md | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/guides/source/api_app.md b/guides/source/api_app.md index f373d313cc..64200ec242 100644 --- a/guides/source/api_app.md +++ b/guides/source/api_app.md @@ -206,16 +206,17 @@ An API application comes with the following middleware by default: - `ActiveSupport::Cache::Strategy::LocalCache::Middleware` - `Rack::Runtime` - `ActionDispatch::RequestId` +- `ActionDispatch::RemoteIp` - `Rails::Rack::Logger` - `ActionDispatch::ShowExceptions` - `ActionDispatch::DebugExceptions` -- `ActionDispatch::RemoteIp` - `ActionDispatch::Reloader` - `ActionDispatch::Callbacks` - `ActiveRecord::Migration::CheckPending` - `Rack::Head` - `Rack::ConditionalGet` - `Rack::ETag` +- `MyApi::Application::Routes` See the [internal middleware](rails_on_rack.html#internal-middleware-stack) section of the Rack guide for further information on them. @@ -360,7 +361,7 @@ middleware set, you can remove it with: config.middleware.delete ::Rack::Sendfile ``` -Keep in mind that removing these middleware will remove support for certain +Keep in mind that removing these middlewares will remove support for certain features in Action Controller. Choosing Controller Modules @@ -385,8 +386,9 @@ controller modules by default: hooks defined by Action Controller (see [the instrumentation guide](active_support_instrumentation.html#action-controller) for more information regarding this). -- `ActionController::ParamsWrapper`: Wraps the parameters hash into a nested hash, +- `ActionController::ParamsWrapper`: Wraps the parameters hash into a nested hash, so that you don't have to specify root elements sending POST requests for instance. +- `ActionController::Head`: Support for returning a response with no content, only headers Other plugins may add additional modules. You can get a list of all modules included into `ActionController::API` in the rails console: @@ -394,12 +396,12 @@ included into `ActionController::API` in the rails console: ```bash $ bin/rails c >> ActionController::API.ancestors - ActionController::Metal.ancestors -=> [ActionController::API, - ActiveRecord::Railties::ControllerRuntime, - ActionDispatch::Routing::RouteSet::MountedHelpers, - ActionController::ParamsWrapper, - ... , - AbstractController::Rendering, +=> [ActionController::API, + ActiveRecord::Railties::ControllerRuntime, + ActionDispatch::Routing::RouteSet::MountedHelpers, + ActionController::ParamsWrapper, + ... , + AbstractController::Rendering, ActionView::ViewPaths] ``` |