[ckan-dev] RFC: routes - named routes and redirects

Mark Wainwright mark.wainwright at okfn.org
Mon Sep 3 10:24:53 UTC 2012


On an (I think) related note, I always find it slightly disturbing
that the search page is not called /search but /dataset, which from a
user point of view seems quite wrong, though it might make perfect
sense for the code.

Mark


On 3 September 2012 11:15, Ross Jones <ross.jones at okfn.org> wrote:
> Personally I think named routes are a nice way for people writing templates, or extensions to not have to know the internal implementation details of which method in which controller something is implemented.
>
> Agree that we should be deprecating /package for 2.0. Some of the others /users/ -> /user/ are just to maintain pretty urls, and as far as I can tell harmless. Aren;'t they?
>
> Ross
>
>
> On 3 Sep 2012, at 11:04, Toby Dacre wrote:
>
>> Hi,
>>
>> I Think we should be a bit more consistent in our use of routes
>>
>> named routes
>> --------------------
>> sometimes we use named routes eg
>>     m.connect('storage_api', '/api/storage', action='index')
>>
>> Sometimes not eg
>>     m.connect('/feeds/group/{id}.atom', action='group')
>>
>> personally I'd remove all named routes and just use the controller=.., action=.. approach
>>
>>
>> redirects
>> -------------
>>
>> sometimes we do redirects like
>>     map.redirect('/users/{url:.*}', '/user/{url}')
>>
>> Do we really want to encourage the use of multiple urls going to the same place - some such as
>>     map.redirect('/package/{url:.*}', '/dataset/{url}')
>>
>> are needed for backwards compatibility (but for how long?)- and in this case because the ckanclient was never updated but do we want to do this?  The users example above is really bad because /users/moo works but /users gives a 404
>>
>> While I'd like to see these removed from routes how about as part of 2.0 I'm really keen we don't add more.  What do the rest of you think?
>>
>> Toby
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev



-- 
Mark Wainwright, CKAN Community Co-ordinator
Open Knowledge Foundation http://okfn.org/
CKAN on Twitter: @CKANproject




More information about the ckan-dev mailing list