Shopify/batman — Issue #235: Defining helper filters on a controller or view
Author: jamesmacaulay
Created: 2011-11-15 20:55:45+00:00
State: open
Labels: Feature

We should have an easy way of defining filters for use in particular controllers or views. For example, a filter to generate a preview link for an article may only be needed in the ArticlesController. Here's one interface we could provide:

```coffeescript
class App.ArticlesController extends Batman.Controller
@filter 'previewURL', (article) ->
"/preview_article?previewID=#{article.get('previewID')}"
```

```html
Preview this article
```