mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +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
|
include ActionView::Helpers
|
||||||
|
|
||||||
def all_options(selected = nil)
|
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
|
# no double select
|
||||||
selected = quick_list.map(&:second).include?(selected) ? '' : selected
|
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
|
quick_options + all_options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue