I have a Rails middleware stack, and I have a piece of MW outside ActionDispatch. Ideally I would like to render a page using ActionDispatch by triggering a URL which is internal (not accessible via usual URL routes) - similar to the way Devise renders it's "auth failed" pages. The best thing would be to just trigger one specific controller action in the application by name, and return it's render result (without having it in the routes even).
What is the standard, modern way of doing this?
UPDATE:
def call(env)
if user_from_env(env).free_accout?
InterestingPagesController.action(:how_to_signup).call(env)
else
@app.call(env)
end
end
You can return a controller action as a Rack endpoint using controller.action, then call the endpoint with endpoint.call() or endpoint[].