# Components

For components, customization can be used to change both the logic (included in a `.rb` file) and the view (included in a `.erb` file). If you only want to customize the logic for, let's say, the `Admin::TableActionsComponent`, create a file named `app/components/custom/admin/table_actions_component.rb` with the following content:

```ruby
load Rails.root.join("app", "components", "admin", "table_actions_component.rb")

class Admin::TableActionsComponent
  # Your custom logic here
end
```

Check the [models customization](/tech_docs/customization/models.md) section for more information about customizing Ruby classes.

If, on the other hand, you also want to customize the view, you need a small modification. Instead of the previous code, use:

```ruby
class Admin::TableActionsComponent < ApplicationComponent; end

load Rails.root.join("app", "components", "admin", "table_actions_component.rb")

class Admin::TableActionsComponent
  # Your custom logic here
end
```

This will make the component use the view in `app/components/custom/admin/table_actions_component.html.erb`. You can create this file and customize it to your needs, the same way you can [customize views](/tech_docs/customization/views.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.consuldemocracy.org/tech_docs/customization/components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
