Add true wildcard for "rest of the path" in mappings
Reported by dan (at zeraweb) | July 20th, 2008 @ 11:11 PM | in 0.8.0 - Frozen Donkey Wheel
Sometimes you just want to match everything after a certain point. In that case, you just use "true":
map :foo, :get => [ :foo, true ] ...
In the case where you want to capture the path from that point, just do it like this:
map :foo, :get => [ :foo, :bar => true ] ...
Comments and changes to this ticket
-
dan (at zeraweb) August 17th, 2008 @ 04:19 PM
- Assigned user changed from dan (at zeraweb) to Matthew King
Implemented, but needs test. Works correctly in Pages.
The first case adds true element to params hash with the rest of the path as an array. The second adds it using the given key.
Given ...
map :foo, :get => [ :foo, :bar => true ]
This will match '/a/b/c/d' and place [ 'b', 'c', 'd' ] in params['bar'].
-
Matthew King August 18th, 2008 @ 01:20 PM
- State changed from new to open
-
dan (at zeraweb) October 26th, 2008 @ 10:51 PM
Do we have a test for this yet? Seems to be working ...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Resource-oriented Web apps.