module
Amber::Router::NamedRoutes
Overview
Provides runtime path and URL helper generation for named routes.
Named routes are registered when the route_name: parameter is passed
to route definitions in the DSL.
Usage: NamedRoutes.path(:user, id: "5") # => "/users/5" NamedRoutes.url(:user, id: "5") # => "http://localhost:3000/users/5" NamedRoutes.path(:users, page: "2") # => "/users?page=2"
Defined in:
amber/router/named_routes.crClass Method Summary
-
.path(name : Symbol, **params) : String
Generates a path string for the given named route, substituting parameter placeholders and appending extra params as query string.
-
.url(name : Symbol, **params) : String
Generates a full URL for the given named route, including scheme, host, and port.
Class Method Detail
Generates a path string for the given named route, substituting parameter placeholders and appending extra params as query string.
Generates a full URL for the given named route, including scheme, host, and port.