Namespace middleware fix #20

Merged
merged 3 commits into from Jul 10, 2013

3 participants

@tomaash

Before, this didn't work:

map.namespace 'api', {middleware: mw.requireAdmin}, (api) ->
    api.resources 'users'
    api.resources 'places', (place) ->
      place.get 'children', 'places#showChildren'
      place.collection (places) ->
        places.get 'find', 'places#findByName'

Middleware from this needs to be added to params

@tomaash tomaash Middleware doesn't get propagated to namespaced and custom routes
Before, this didn't work.

map.namespace 'api', {middleware: mw.requireAdmin}, (api) ->
    api.resources 'users'
    api.resources 'places', (place) ->
      place.get 'children', 'places#showChildren'
      place.collection (places) ->
        places.get 'find', 'places#findByName'

Middleware from this needs to be added to params
0e9ad2a
@vjpr

+1

@1602 1602 merged commit 13254d3 into 1602:master Jul 10, 2013

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment