# Calling the method like so will give us an instance of a Post
Comment.first.post => #<post:0x00000001685bb558 ...>

class Avo::Resources::Comment < Avo::BaseResource
  def fields
    # This will run `record.post` and try to display whatever is returned.
    field :post, as: :record_link
  end
end
```

<Image src="/assets/img/fields/record_link/record-link.png" width="876" height="160" alt="Record link field" />

## Options

Besides some of the default options, there are a few custom ones.

<Option name="`target`">

In case you want to set the target to `_blank`.

#### Default value

`nil`

#### Possible values

`:self`, `:blank`

#### Example

```ruby
field :post, as: :record_link, target: :blank
```
</Option>

<Option name="`use_resource`">

Because you only give it an instance of a record, Avo will try to guess which resource it should use to display the title of the record and how to compute it's link.
With more advanced configurations (when you have multiple resources for the same model) that resource might not be the one that you wish for.

Using the `use_resource` configuration value you can tell Avo which resource it should use.

#### Default value

`nil`

#### Possible values

`big_post`, `AdminUser`, `Avo::Resources::TinyPhoto`

#### Example

```ruby
field :post, as: :record_link, use_resource: "big_post"

field :admin, as: :record_link, use_resource: "AdminUser"

field :thumbnail, as: :record_link, use_resource: "Avo::Resources::TinyPhoto"
```
</Option>

<Option name="`add_via_params`">

In other places where Avo generates a link to a record like in the `belongs_to` field, Avo adds `via` params to the URL so it knows how to generate the back button link.
That URL can also be passed on to other team mates and everyone can have the same navigation experience.

In the `record_link` field Avo adds these params automatically, but that might not be what you want. You can remove those `via` params by setting the `add_via_params` option to `false`.

#### Default value

`true`

#### Possible values

`true`, `false`

#### Example

```ruby