Class ActionController::Metal
In: lib/action_controller/metal.rb
Parent: AbstractController::Base

ActionController::Metal provides a way to get a valid Rack application from a controller.

In AbstractController, dispatching is triggered directly by calling process on a new controller. ActionController::Metal provides an action method that returns a valid Rack application for a given action. Other rack builders, such as Rack::Builder, Rack::URLMap, and the Rails router, can dispatch directly to the action returned by FooController.action(:index).

Methods

Public Class methods

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

Returns the last part of the controller‘s name, underscored, without the ending "Controller". For instance, MyApp::MyPostsController would return "my_posts" for controller_name

Returns

String

Public Instance methods

Basic implementations for content_type=, location=, and headers are provided to reduce the dependency on the RackDelegation module in Renderer and Redirector.

Delegates to the class’ controller_name

:api: private

basic url_for that can be overridden for more robust functionality

[Validate]