mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 00:33:36 +02:00
Disable possibility to select --- value from select #2517
This commit is contained in:
parent
78e898c6dc
commit
6eaf6badc0
1 changed files with 2 additions and 2 deletions
|
@ -6,12 +6,12 @@ class SortedCountry
|
|||
include ActionView::Helpers
|
||||
|
||||
def all_options(selected = nil)
|
||||
quick_options = options_for_select(quick_list + [['---', '']], selected)
|
||||
quick_options = options_for_select([['','']] + quick_list, { selected: selected })
|
||||
|
||||
# no double select
|
||||
selected = quick_list.map(&:second).include?(selected) ? '' : selected
|
||||
|
||||
all_options = options_for_select(all_sorted_truncated, selected)
|
||||
all_options = options_for_select([['---', '---']] + all_sorted_truncated, { selected: selected, disabled: ['---'] })
|
||||
quick_options + all_options
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue