fabrik42/acts_as_api — Issue #53: Possible to filter rendered Results?
Author: martinjuhasz
Created: 2011-12-30 13:24:48+00:00
State: open

Some sample of a `Text` Object

```ruby
#texts_controller.rb
def index
@texts = current_user.company.texts
respond_to do |format|
format.html
format.json { render_for_api :texts_all, :json => @texts, :root => :texts }
end
end
```

```ruby
#text.rb
acts_as_api

api_accessible :texts_all do |template|
template.add :title
template.add :content
template.add :attachments
end
```

my `Text` Model does have a boolean atrribute called `activated`.
is there a way to filter the `unless activated?` texts from the api so that they get not shown in my json? i want to see them on the html page however.

any ideas?