Skip to content

Documentation issues #59

@rainierwolfcastle

Description

@rainierwolfcastle

I'm playing around with Matador and there are a few places where the documentation on the github project page doesn't match the current implementation (or, I'm doing it wrong).

e.g. Adding a before filter:

module.exports = function (app, config) {   
  return app.controllers.Base.extend(function() {
    this.addBeforeFilter(this.requireAuth);
  }).methods({
    requireAuth: function(callback) {
      return callback(null);
    }
  });
}

Gives me the following error:

TypeError: object is not a function
    at IncomingMessage.CALL_NON_FUNCTION (native)
    at /Users/taylorr/Code/myapp/app/controllers/ApplicationController.js:7:14
    at callbacks (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:272:11)
    at param (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:246:11)
    at pass (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:253:5)
    at Router._dispatch (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:280:4)
    at Object.handle (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/lib/router/index.js:45:10)
    at next (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/node_modules/connect/lib/http.js:204:15)
    at next (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/node_modules/connect/lib/http.js:206:9)
    at Object.methodOverride [as handle] (/Users/taylorr/Code/myapp/node_modules/matador/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:35:5)

Can you help me out here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions