railway-routes icon indicating copy to clipboard operation
railway-routes copied to clipboard

HTTP PATCH support

Open vjpr opened this issue 11 years ago • 1 comments

vjpr avatar Jun 09 '13 08:06 vjpr

The following doesn't work because a trailing slash is appended like so: /api/links/:id/

map.namespace 'api', (api) ->
    api.resources 'links', (links) ->
      links.patch '', 'links#patch'
    api.resources 'users'

Workaround:

map.namespace 'api', (api) ->
    api.resources 'links', (links) ->
    api.patch 'links/:id', 'links#patch'
    api.resources 'users'

Ideal solution:

Some way to modify availableRoutes in #getActiveRoutes

Also:

Allow null or optional first arg to be passed to a Map indicating a root resource.

map.namespace 'api', (api) ->
    api.resources 'links', (links) ->
      links.patch null, 'links#patch'
    api.resources 'users'

vjpr avatar Jun 09 '13 08:06 vjpr