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

Toby Dacre toby.okfn at gmail.com
Mon Sep 3 11:00:25 UTC 2012


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

Maybe they are useful for this seperation is good but in that case all/most
routes should have named routes and we should have a naming convention

>
> 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?
>
> Personally I don't like the 2 different urls go to the same place as it's
confusing and as I said /users possibly the only one that makes sense eg
/users/moo and /users/new feel they shouldn't be plurals but /user for the
user list shouldn't be singular - also these are extra lines of code and
the less code the less errors


> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120903/8ab8b83e/attachment-0001.html>


More information about the ckan-dev mailing list