# Has One

The `HasOne` association shows the unfolded view of your `has_one` association. It's like peaking on the `Show` view of that associated record. The user can also access the `Attach` and `Detach` buttons.

```ruby
field :admin, as: :has_one
```

<Image src="/assets/img/associations/has-one.jpg" width="919" height="824" alt="Has one" />

## Options

<Option name="`searchable`">

<div class="space-x-2">
  <LicenseReq license="pro" />
  <DemoVideo demo-video="https://youtu.be/KLI_sVTPX-Q" />
</div>

Turns the attach field/modal from a `select` input to a searchable experience

```ruby{5}
class Avo::Resources::CourseLink < Avo::BaseResource
  def fields
    field :links,
      as: :has_many,
      searchable: true
  end
end
```

:::warning
  Avo uses the **search feature** behind the scenes, so **make sure the target resource has the `search_query` option configured**.
:::

```ruby{3-7}