class method
self.action
Ruby on Rails 3.0.20
Since v3.0.20Signature
self.action(name, klass = ActionDispatch::Request)
Return a rack endpoint for the given action. Memoize the endpoint, so multiple calls into MyController.action will return the same object for the same action.
Parameters
- action<#to_s>
-
An action name
Returns
- Proc
-
A rack application
Parameters
-
namereq -
klassopt = ActionDispatch::Request
Source
# File actionpack/lib/action_controller/metal.rb, line 176
def self.action(name, klass = ActionDispatch::Request)
middleware_stack.build(name.to_s) do |env|
new.dispatch(name, klass.new(env))
end
end
Defined in actionpack/lib/action_controller/metal.rb line 176
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Metal