Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Add true wildcard for "rest of the path" in mappings

#68

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 ] ...

Reported by dan (at zeraweb) · July 20th, 2008 @ 11:11 PM

State: open
Assigned to: Matthew King Matthew King

Activity

  1. dan (at zeraweb)
    dan (at zeraweb)
    • 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'].

    August 17th, 2008 @ 04:19 PM

  2. Matthew King
    Matthew King
    • State changed from new to open

    August 18th, 2008 @ 01:20 PM

  3. dan (at zeraweb)
    dan (at zeraweb)

    Do we have a test for this yet? Seems to be working ...

    October 26th, 2008 @ 10:51 PM

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.