Skip to content

Commit

Permalink
Document how to customize Field::Select option labels
Browse files Browse the repository at this point in the history
  • Loading branch information
cabe56 authored and pablobm committed Jul 24, 2022
1 parent b222dc9 commit 5c278d7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/customizing_dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ objects to display as.
`:collection` - Specify the options shown on the select field. It accept either
an array or an object responding to `:call`. Defaults to `[]`.

To customize option labels, pass an array of pairs where the first element is the value submitted with the form and the second element is the label shown to the user.

For example:

```ruby
currency = Field::Select.with_options(
collection: [ ['usd', 'Dollar'], ['eur', 'Euro'], ['yen', 'Yen'] ]
)

```

`:searchable` - Specify if the attribute should be considered when searching.
Default is `true`.

Expand Down

0 comments on commit 5c278d7

Please sign in to comment.