mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Improve guides note about using a proc/lambda as a route endpoint
[ci skip]
This commit is contained in:
parent
e848e8861d
commit
f7b65ee0c4
1 changed files with 1 additions and 1 deletions
|
@ -920,7 +920,7 @@ As long as `MyRackApp` responds to `call` and returns a `[status, headers, body]
|
|||
|
||||
NOTE: For the curious, `'articles#index'` actually expands out to `ArticlesController.action(:index)`, which returns a valid Rack application.
|
||||
|
||||
NOTE: Since procs/lambdas are objects that happen to respond to `call` you can implement very simple routes (e.g. for health checks) inline:<br>`get '/health', to: ->(env) { [204, {}, ''] }`
|
||||
NOTE: Since procs/lambdas are objects that respond to `call`, you can implement very simple routes (e.g. for health checks) inline:<br>`get '/health', to: ->(env) { [204, {}, ['']] }`
|
||||
|
||||
If you specify a Rack application as the endpoint for a matcher, remember that
|
||||
the route will be unchanged in the receiving application. With the following
|
||||
|
|
Loading…
Reference in a new issue