class method
self.action
Ruby on Rails 3.2.22.5
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- An action name
Returns
-
proc- A rack application
Parameters
-
namereq -
klassopt = ActionDispatch::Request
Source
# File actionpack/lib/action_controller/metal.rb, line 244
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 244
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Metal