# app/avo/resources/movie.rb
class Avo::Resources::Movie < Avo::Resources::ArrayResource
  self.components = { # [!code --]
    "Avo::Views::ResourceIndexComponent": Avo::Views::ResourceCustomIndexComponent # [!code --]
  } # [!code --]

  # ...
end
```

With this change in place, every resource will automatically use the custom index component, no extra configuration needed. However, that raises a practical question: what if some resources should have a message, and others shouldn't?

Let's make the component more flexible by introducing a lightweight DSL extension.

## Make the message configurable via a resource method

To turn our static message into something dynamic and optional we'll fetch the message from a method on each resource. If a resource defines the `index_message` method, the component will render it. If not, it won’t show anything.

Let’s update the Ruby component to support this:

```ruby