See https://github.com/web2py/web2py/blob/master/examples/routes.parametric.example.py#L41. You can use the parameter-based router and specify a list of functions associated with the controller in question -- that will allow the router to determine that the arg is really an arg when the function is missing.
Anthony On Thursday, January 25, 2018 at 10:21:27 AM UTC-5, Yan Wong wrote: > > I have a non-default controller with a default function, index(), which > uses the index.html view, and which accepts arguments that begin with an @ > sign. When I go to www.mysite.org/controller/index/@arg1 it rightly fires > off the index() function with args = ["@arg1"]. And when I go to > www.mysite.org/controller/ it also fires off index(). But If I go to > > www.mysite.org/controller/@arg1 > > rather than using the default index() function, web2py takes the @arg1 > portion of the URL as the function, and as is a non-allowed name, this > fails. > > The short alternative is to use www.mysite.org/controller//@arg1 but I > think the double slash is ugly. Is there any way to get > www.mysite.org/controller/@arg1 to call the default function in > controller, with args=['@arg1']? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.