Comments (5)
what does your routes.js
file look like, and what controller is handling the request, and what does the code look like that handles the beforeFilter.
- Dustin
from matador.
my routes.js
module.exports = { root: [ ['get', '/', 'Home'], ['get', '/about', 'Home', 'about'], ['get', '/registration', 'Registration', 'registration'] ] }
Excerpt from controller (called on index):
index: function () {
this.response.render('index', {
locals: {
title: 'Some title'
}
})
},```
beforeFilter is as described in matador's sample
BaseController.js
```, addBeforeFilter: function (actions, fn) {
if (!fn) { fn = actions, actions = null }
v(v.is.arr(actions) ? actions : [actions]).each(function (action) {
beforeFilters.push({
action: action
, filter: fn
})
})
}```
```beforeFilters = []```
Wish I could explain to a greater detail, but it's pretty simple, really
Grgur
from matador.
i think i know what happened.... which is likely anyone upgrading to others (i should have bumped this as a minor release, instead of patch).
you'll more than likely need to change the first line of your ApplicationController.js
to be this:
module.exports = require('matador').BaseController.extend(function () {
i'm pretty sure i changed over the ownership of the BaseController to be in the module, and not the scaffold
from matador.
You're right, changing it to
module.exports = require('matador').BaseController.extend(function () {})
actually fixed the issue
I updated to 0.0.12, too, and it works just great
Thanks for matador, btw, It's awesome. I have it running in production here: http://sourcedevcon.eu
from matador.
glad that worked! super cool to see it in action :)
from matador.
Related Issues (20)
- https setup HOT 1
- How do you parse the body of a POST request? HOT 2
- There is a mention of a responseRouter variable that is not mentioned anywhere else in the project. HOT 6
- Using jade and stylus? HOT 6
- Example code? HOT 5
- How I get access to model? HOT 1
- First run of server.js: unhandled errors HOT 5
- Confusion over description HOT 1
- Error loading file HOT 3
- unclear docs about how to use the controllers in the 2 version
- website URL in description wrong HOT 1
- autoescape issue on alpha 6 HOT 1
- Parameter and wildcard matches are decodeURIed twice HOT 6
- Session doesn't persist through res.redirect HOT 1
- Documentation issues
- can't pass options to express.static middleware HOT 1
- autogenerated app error HOT 8
- Example https://github.com/Obvious/matador - admin
- Nevermind.
- node.js v0.8.6 error in BaseController
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matador.