Core: Route resource in resource

Created on 3 Dec 2016  路  5Comments  路  Source: adonisjs/core

@thetutlage are you planning add nested resources?

Route
.resource('r1')
.only('index')
.addResource('r2', (resource) => {
  resource.only('create')
  resource.addMember('m2', ['GET'])
  resource.addResource('r3')
})

// GET  r1
// POST r1/:id/r2
// GET  r1/:id/r2/:r2_id/m2
// GET  r1/:id/r2/:r2_id/r3/:r3_id
// ...

Most helpful comment

Will add it to the docs

All 5 comments

You can simply use dot notation

Route.resource('r1.r2', 'R2Controller')

@thetutlage Great! I didn't know about it (no documentation)

Will add it to the docs

Fixed, will be deployed soon.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

begueradj picture begueradj  路  3Comments

ghost picture ghost  路  3Comments

themodernpk picture themodernpk  路  3Comments

navdeepsingh picture navdeepsingh  路  3Comments

dezashibi picture dezashibi  路  4Comments