Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3 from RomainLanz/fix-controller-generator
Browse files Browse the repository at this point in the history
fix(controller): add one restful method
  • Loading branch information
thetutlage committed Jan 26, 2016
2 parents ab64240 + 994aec2 commit b9200f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Generators/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const utils = require('./helpers')
const path = require('path')
const Ioc = require('adonis-fold').Ioc
const controllerString = require('./strings').controller
const methods = ['index', 'create', 'store', 'show', 'update', 'destroy']
const methods = ['index', 'create', 'store', 'show', 'edit', 'update', 'destroy']

let Controller = exports = module.exports = {}

Expand Down
2 changes: 1 addition & 1 deletion src/Generators/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {{name}}
strings.controller = `'use strict'
class {{name}} {
{{index}}{{create}}{{store}}{{show}}{{update}}{{destroy}}
{{index}}{{create}}{{store}}{{show}}{{edit}}{{update}}{{destroy}}
}
module.exports = {{name}}
Expand Down
2 changes: 2 additions & 0 deletions test/commands.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ describe('Generators', function () {
expect(user.show).to.be.a('function')
expect(user.create).to.be.a('function')
expect(user.store).to.be.a('function')
expect(user.edit).to.be.a('function')
expect(user.update).to.be.a('function')
expect(user.destroy).to.be.a('function')
})
Expand All @@ -171,6 +172,7 @@ describe('Generators', function () {
expect(accounts.create).to.equal(undefined)
expect(accounts.store).to.equal(undefined)
expect(accounts.show).to.equal(undefined)
expect(accounts.edit).to.equal(undefined)
expect(accounts.update).to.equal(undefined)
expect(accounts.destroy).to.equal(undefined)
})
Expand Down

0 comments on commit b9200f1

Please sign in to comment.