I have an 'admin' subcontroller off my root controller. This has an
'index' controller. The HTML for the index contains several relative
links to other methods on the admin controller.

Usually this page will be reached via http://localhost/admin/.
Unfortunately it can also be reached by http://localhost/admin (no
trailing slash) which means relative links break with the browser
trying to find them off the root. This can be fixed by using the
with_trailing_slash decorator, which appends the trailing slash,
meaning /admin redirects to /admin/. All well and good.

But now you get the other problem - although /admin/ works, /admin/
index now redirects to /admin/index/, meaning all the relative links
now look for a non-existent 'index' controller.

Ideally I'd like to find a way to serve up the admin index page so
that it will always appear at the same level in the URL hierarchy. I
don't want it to be possible to display that (or indeed any other)
controller in more than one level of the URL hierarchy. Is this
possible?

I would prefer not to have to change everything to using absolute
URLs. There's a hint at 
http://www.turbogears.org/2.0/docs/main/Controllers.html#subcontrollers-and-the-url-hierarchy
that absolute URLs are preferred, but that is a shame as relative URLs
are typically shorter and easier to maintain.

--
Ben Sizer

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to