So, it turns out I missed noticing the lines:

    map.connect('/{controller}/{action}')
    map.connect('/{controller}/{action}/{id}')

and didn't think about the order of my routes and these... By putting these
default routes after mine it fixed the problem - as {action} was not being
picked up first...

On Sat, Aug 14, 2010 at 4:59 PM, G <[email protected]> wrote:

> Greetings, I am a new pylons user coming from the grails world. I'm
> attempting to get my toes wet by trying to build a simple RESTful web
> service. (using pylons 1.0)
>
> My most recent problem is trying to get routing working, I'm hoping to
> be able to do the following:
>     map.connect('/books', controller='books', action='index',
> conditions=dict(method=['GET']))
>     map.connect('/books/{id}', controller='books', action='show',
> conditions=dict(method=['GET']))
>
> It works great for the index action... however, I was hoping to be
> able to pass parameters (id) without specifying an action (using books/
> 1 instead of books/show/1), but localhost:5050/books/1 treats 1 as
> though it is an action.
>
> Any advice for what would be the correct way to do this?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<pylons-discuss%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to