Giter VIP home page Giter VIP logo

Comments (5)

ded avatar ded commented on August 18, 2024

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.

grgur avatar grgur commented on August 18, 2024

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.

ded avatar ded commented on August 18, 2024

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.

grgur avatar grgur commented on August 18, 2024

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.

ded avatar ded commented on August 18, 2024

glad that worked! super cool to see it in action :)

from matador.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.