Skip to content

Commit

Permalink
Add a tiny more detail about the middleware stack
Browse files Browse the repository at this point in the history
  • Loading branch information
zzak committed May 29, 2023
1 parent e68732e commit 7a014c0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 12 additions & 1 deletion actionpack/lib/action_controller/metal.rb
Expand Up @@ -265,7 +265,18 @@ def use(...)
end
end

# Alias for +middleware_stack+.
# The middleware stack used by this controller.
#
# By default uses a variation of ActionDispatch::MiddlewareStack which
# allows for the following syntax:
#
# class PostsController < ApplicationController
# use AuthenticationMiddleware, except: [:index, :show]
# end
#
# Read more about {Rails middleware
# stack}[https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack]
# in the guides.
def self.middleware
middleware_stack
end
Expand Down
5 changes: 5 additions & 0 deletions actionpack/lib/action_dispatch/middleware/stack.rb
Expand Up @@ -4,6 +4,11 @@
require "active_support/dependencies"

module ActionDispatch
# = Action Dispatch \MiddlewareStack
#
# Read more about {Rails middleware
# stack}[https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack]
# in the guides.
class MiddlewareStack
class Middleware
attr_reader :args, :block, :klass
Expand Down

0 comments on commit 7a014c0

Please sign in to comment.