Hello,

I've been working with the restconroler described at

http://routes.groovie.org/manual.html#restful-services

The code example following "The default mapping that map.resource sets
up looks like this:" has quoting problems, which makes it hard to
experiment with. Here is a corrected version:

map.resource('message', 'messages')
# Will setup all the routes as if you had typed the following map
commands:
map.connect('messages', controller='messages', action='create',
    conditions=dict(method=['POST']))
map.connect('messages', 'messages', controller='messages',
action='index',
    conditions=dict(method=['GET']))
map.connect('formatted_messages', 'messages.:(format)',
controller='messages', action='index',
    conditions=dict(method=['GET']))
map.connect('new_message', 'messages/new', controller='messages',
action='new',
    conditions=dict(method=['GET']))
map.connect('formatted_new_message', 'messages/new.:(format)',
controller='messages', action='new',
    conditions=dict(method=['GET']))
map.connect('messages/:id', controller='messages', action='update',
    conditions=dict(method=['PUT']))
map.connect('messages/:id', controller='messages', action='delete',
    conditions=dict(method=['DELETE']))
map.connect('edit_message', 'messages/:(id);edit',
controller='messages', action='edit',
    conditions=dict(method=['GET']))
map.connect('formatted_edit_message', 'messages/:(id).:(format);edit',
controller='messages',
    action='edit', conditions=dict(method=['GET']))
map.connect('message', 'messages/:id', controller='messages',
action='show',
    conditions=dict(method=['GET']))
map.connect('formatted_message', 'messages/:(id).:(format)',
controller='messages', action='show',
    conditions=dict(method=['GET']))

Being able to experiment with this code was very helpful for me when
trying to understand the rest controller. Would someone update the
documentation when time allows?

Thanks,

--David Niergarth


--~--~---------~--~----~------------~-------~--~----~
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