jaredhanson/locomotive — pull request #74 by ragulka (2013-01-30 23:20:20+00:00)
Title: Allow selecting which actions a filter applies to using 'only' and 'except'

This is a feature request.

I find that it would be very useful if we could specify which controller actions we want to apply a filter to, in a similar manner how we can define routes.

I imagine something like this:

```javascript
UsersController.before({ only: ['show','create']}, function(next) {
next();
});

UsersController.before({ except: ['destroy']}, function(next) {
next();
});
```

This becomes very useful when you need to apply a filter to more than one, but not all your actions. Keeps things DRY.

EDIT: Looking at the source code I realized that it's already possible to apply a filter to multiple actions when passing an array of actions instead a single action name or wilcard. Still, it would be nice if we could apply filters to all actions, except a few.