# app/helpers/posts_helper.rb
module PostsHelper
  def extract_excerpt(body)
    ActionView::Base.full_sanitizer.sanitize(body).truncate 120
  end
end
```

Now, you'd like to use that helper inside one of you computed fields.

```ruby
class Avo::Resources::Post < Avo::BaseResource
  def fields
    field :excerpt, as: :text do |model|
      extract_excerpt model.body
    end
  end
end
```

Initially you'll get an error similar to `undefined method 'extract_excerpt' for #<Avo::Fields::TextField>`. That's because the compute field executes that method in a scope that's different from your application controller, thus not having that method present.

## The solution

The fix is to include the helper module in the `BaseField` and we can do that using this snippet somewhere in the app (you can add it in `config/initializers/avo.rb`).

```ruby