Skip to content

Commit

Permalink
fix: controllers are not properly resolving for resources with custom…
Browse files Browse the repository at this point in the history
… paths (#478)
  • Loading branch information
zacharygolba authored Oct 22, 2016
1 parent 1a52cc1 commit bbf6800
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 0 additions & 7 deletions src/packages/compiler/utils/create-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ function createWriter(file: string) {
const path = joinPath('app', pluralize(type), item);
const name = chain(item)
.pipe(formatName)
.pipe(str => {
if (str.endsWith('Application')) {
return str;
}

return pluralize(str);
})
.pipe(str => str + capitalize(type))
.value();

Expand Down
10 changes: 9 additions & 1 deletion src/packages/router/definitions/context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ export function contextFor(build: Router$DefinitionBuilder<*>) {
path = namespace.path + opts.path;
}

const controllerKey = path.substr(1);
const controllerKey = path
.split('/')
.filter(Boolean)
.reduce((arr, str, index, parts) => [
...arr,
index === parts.length - 1 ? opts.name : str
], [])
.join('/');

const controller = controllers.get(controllerKey);

if (!controller) {
Expand Down

0 comments on commit bbf6800

Please sign in to comment.