On Mon, Jul 21, 2008 at 5:29 AM, Thomas G. Willis <[EMAIL PROTECTED]> wrote:
>
>
>
> On Jul 20, 5:20 pm, "Mike Orr" <[EMAIL PROTECTED]> wrote:
>> On Sun, Jul 20, 2008 at 8:45 AM, Thomas G. Willis <[EMAIL PROTECTED]> wrote:
>>
>> > One more thing, and this may just be my problem but, while working
>> > through the examples I'm constantly having to put a trailing "/" on
>> > the end of my urls for my controllers/actions. I assume this is
>> > probably something to change in the routing but there must've been a
>> > detail I missed somewhere or it's missing.
>>
>> It sounds like you put trailing "/"'s on the paths in your route
>> definitions.  Some people do this, as if /articles/1234/ is better
>> than /articles/1234.  But obviously that's a useless inconvenience
>> unless the last component is really directory-like conceptually.  I
>> don't know if there are trailing slashes in the book, but if there are
>> it's a bug.
>>
>
>
> Thanks I'll look into it but unless I'm mistaken, the routing is the
> default that paste setup at project generation.
>
> I'm also noticing that globals and helpers don't come into the
> controllers for some reason, perhaps it's all related but I haven't
> had time to get to the bottom of it.

The default routing template in Pylons-dev has changed a lot the
several days.  At one point it did have a trailing slash which was a
bug.  The current hg version has:

def make_map():
    """Create, configure and return the routes Mapper"""
    map = Mapper(directory=config['pylons.paths']['controllers'],
                 always_scan=config['debug'])
    map.minimization = False

    # The ErrorController route (handles 404/500 error pages); it should
    # likely stay at the top, ensuring it can always be resolved
    map.connect('/error/{action}/{id}', controller='error')

    # CUSTOM ROUTES HERE

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

(The {varname} syntax is valid starting with Routes 1.9, and is
equivalent to :varname.  Note that you need a LEADING slash if
map.minimization=False.)

Ben: do error pages really have IDs?

 --
Mike Orr <[EMAIL PROTECTED]>

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