# Trix

```ruby
field :body, as: :trix
```

The `Trix` field renders a [WYSIWYG Editor](https://trix-editor.org/) and can be associated with a `string` or `text` column in the database. The value stored in the database will be the editor's resulting `HTML` content.

It supports [ActiveStorage](https://guides.rubyonrails.org/active_storage_overview.html) file attachments, [ActionText](https://guides.rubyonrails.org/action_text_overview.html), and seamlessly integrates with the Media Library.

<Image src="/assets/img/fields/trix.jpg" width="877" height="193" alt="Trix field" />

Trix field is hidden from the `Index` view.

## Options

<Option name="`always_show`">

By default, the content of the field is not visible on the `Show` view; instead, it's hidden under a `Show Content` link that, when clicked, displays the content. You can set it to display the content by setting `always_show` to `true`.

</Option>

<Option name="`attachments_disabled`">

Hides the attachments button from the Trix toolbar.

#### Default

`false`

#### Possible values

`true`, `false`
</Option>

<Option name="`hide_attachment_filename`">

Hides the attachment's name from the upload output in the field value.

#### Default

`false`

#### Possible values

`true`, `false`
</Option>

<Option name="`hide_attachment_filesize`">

Hides the attachment size from the upload output in the field value.

#### Default

`false`

#### Possible values

`true`, `false`
</Option>

<Option name="`hide_attachment_url`">

Hides the attachment URL from the upload output in the field value.

#### Default

`false`

#### Possible values

`true`, `false`
</Option>

<Option name="`attachment_key`">

Enables file attachments.

#### Default

`nil`

#### Possible values

`nil`, or a symbol representing the `has_many_attachments` key on the model.
</Option>

## File attachments

:::warning
You must manually require `activestorage` and `image_processing` gems in your `Gemfile`.

```ruby