#68 open
dan (at zeraweb)

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

Reported by dan (at zeraweb) | 2008-07-20 23:11:07 UTC | 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)

    dan (at zeraweb) 2008-08-17 16:19:30 UTC

    • 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

    Matthew King 2008-08-18 13:20:48 UTC

    • State changed from “new” to “open”
  • dan (at zeraweb)

    dan (at zeraweb) 2008-10-26 22:51:53 UTC

    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.

New-ticket Create new ticket

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.

People watching this ticket

Tags

Pages