New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route Constraints #1089
Comments
I'd like to take a stab at this, and in doing so get more comfortable with the amber source code. No guarantees though. |
kvirani
added a commit
to kvirani/amber
that referenced
this issue
Apr 7, 2019
- Resolves amberframework#1089 - Pass constraints through to amber-router's RouteSet: https://github.com/amberframework/amber-router/blob/master/spec/amber_router/route_set/matching/routes_with_variables_spec.cr#L41 - Only Hashes are supported atm. Not sure if we should also be supporting NamedTuple here. Looking for feedback there.
elorest
pushed a commit
that referenced
this issue
Apr 25, 2019
* Add constraints support for routes - Resolves #1089 - Pass constraints through to amber-router's RouteSet: https://github.com/amberframework/amber-router/blob/master/spec/amber_router/route_set/matching/routes_with_variables_spec.cr#L41 - Only Hashes are supported atm. Not sure if we should also be supporting NamedTuple here. Looking for feedback there. * Fix trailing white spaces Thanks ameba * crystal tool format
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since amberframework/amber-router#12 was merged Amber supports adding constraints to its routes, like https://guides.rubyonrails.org/routing.html#segment-constraints.
However there is not currently a method of defining these on a given route/resource.
Should be pretty simple like
Then just pass the constraints to the router when adding the route.
The text was updated successfully, but these errors were encountered: