I've put Routes.py in the root web2py directory. You may be right about a
bug, though. I've loaded up a fresh local copy of web2py, created an app
called a_b, and set up the routing:
routers = dict(
# base router
BASE=dict(
default_application='welcome',
map_hyphen=True,
),
)
All the static files fail, and http://127.0.0.1:8000/a-b returns "invalid
function (default/a_b)"
On Tuesday, 16 December 2014 00:27:03 UTC, Derek wrote:
>
> well, according to the documentation it should work, so perhaps you
> encountered a bug.
>
> Just a question, where did you put your routes.py? if in the application,
> then you can only route controllers and functions.
>
> On Monday, December 15, 2014 3:42:53 AM UTC-7, [email protected]
> wrote:
>>
>> Does anyone know how to get map_hyphen to work with an application name?
>>
>> I have a routes.py setup as follows:
>>
>> routers = dict(
>> BASE = dict(
>> default_application = "home",
>> default_controller = "default",
>> default_function = "index",
>> map_hyphen=True,
>> ),
>> )
>>
>> In my application (tutor_events), controller and function hyphen mapping
>> work fine, so the following paths work:
>> /tutor_events/default/edit-details/424
>> /tutor_events/tutor-fee/add
>>
>> And all URLs are being generated with hyphens
>>
>> But if I try to go to /tutor-events/..., I get an error: invalid function
>> (default/tutor_events)
>> So web2py is trying to send me on to /home/default/tutor_events
>>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.