We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have problems with invoke method. It doesnt see my controllers.
in my initializers/90_last.js i want to invoke 404 page if there is nothing found, but it doesnt resolve controllers.
Here is what i have: app/controllers/pagesController.js
var locomotive = require('locomotive'), Controller = locomotive.Controller; var pagesController = new Controller(); .... pagesController.error404 = function() { this.render(); }; module.exports = pagesController;
config/environments/all.js
var util = require('util'), locomotive = require('locomotive'); module.exports = function() { ... this.use(locomotive.invokable()); };
and in my config/initializers/90_last.js
module.exports = function() { this.use(function(req, res, next) { req.invoke("pages", "error404", next); }); };
The error that i get:
DispatchError: Unable to resolve controller 'pages' at Application._controller (/usr/lib/node_modules/locomotive/lib/application.js:270:17)
Versions: LocomotiveJS: v0.4.2 NodeJS: v0.10.22
The text was updated successfully, but these errors were encountered:
Same issue here...
Sorry, something went wrong.
https://github.com/jaredhanson/locomotive/wiki/Migrating-from-0.3.x-to-0.4.x with v. v0.4.0 I use (config/environments/all.js):
this.use(function(req, res, next) { req.invoke('pages#error404'); });
and it works fine. Is there some bug on v.0.4.2? I didn't update my version yet.
with v0.4.0 there's the same issue
No branches or pull requests
I have problems with invoke method. It doesnt see my controllers.
in my initializers/90_last.js i want to invoke 404 page if there is nothing found, but it doesnt resolve controllers.
Here is what i have:
app/controllers/pagesController.js
config/environments/all.js
and in my config/initializers/90_last.js
The error that i get:
Versions:
LocomotiveJS: v0.4.2
NodeJS: v0.10.22
The text was updated successfully, but these errors were encountered: