Server-side render initial visibility of select help text

Resolves failure to display initial help text of difficulty level.
This commit is contained in:
Andrew Kvalheim 2023-03-10 16:51:36 -08:00
parent e5ab9b4db1
commit 6ed1725b01
3 changed files with 18 additions and 9 deletions

View file

@ -27,16 +27,14 @@
.form-group
= f.label :language
= f.select :language, @languages, { include_blank: false}, { class: 'select-help-toggle form-control' }
- @conference.program.event_types.each do |event_type|
%span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" }
= event_type.description
= render 'shared/select_help_text', f: f, for: :event_type_id, options: @conference.program.event_types do |event_type|
= event_type.description
- if action_is_edit
- if @conference.program.difficulty_levels.any?
= f.label :difficulty_level
= f.select :difficulty_level_id, @conference.program.difficulty_levels.map{|level| [level.title, level.id ] }, {include_blank: false}, { class: 'select-help-toggle form-control' }
- @conference.program.difficulty_levels.each do |difficulty_level|
%span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" }
= difficulty_level.description
= render 'shared/select_help_text', f: f, for: :difficulty_level_id, options: @conference.program.difficulty_levels do |difficulty_level|
= difficulty_level.description
.form-group
= f.label :abstract
= f.text_area :abstract, required: true, rows: 5, data: { provide: 'markdown' }, class: 'form-control'