mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Server-side render initial visibility of select help text
Resolves failure to display initial help text of difficulty level.
This commit is contained in:
parent
e5ab9b4db1
commit
6ed1725b01
3 changed files with 18 additions and 9 deletions
10
app/views/shared/_select_help_text.html.haml
Normal file
10
app/views/shared/_select_help_text.html.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
:ruby
|
||||
include_blank ||= false
|
||||
select_id = field_id(f.object_name, local_assigns[:for])
|
||||
value = f.object.send(local_assigns[:for])
|
||||
|
||||
- options.each_with_index do |option, i|
|
||||
- selected = value.present? ? option.id == value : !include_blank && i == 0
|
||||
|
||||
%span.help-block.select-help-text.collapse{ id: "#{option.id}-help", class: [select_id, ('in' if selected)] }
|
||||
= yield option
|
||||
Loading…
Add table
Add a link
Reference in a new issue