app/views/admin/communication/_abouts.html.erb
<%= f.input :about_type,
collection: Communication::Website.about_types,
input_html: { data: { conditional: true }, id: "about_type" },
label_method: lambda { |object|
I18n.t("#{i18n_key}#{object}")
},
include_blank: false %>
<div class="d-none"
data-conditional-source="about_type"
data-conditional-value="Education::School">
<%= f.input :about_id,
collection: osuny_collection(current_university.education_schools, localized: true),
label: Education::School.model_name.human,
include_blank: false %>
</div>
<div class="d-none"
data-conditional-source="about_type"
data-conditional-value="Education::Program">
<%= f.input :about_id,
collection: osuny_collection_tree(current_university.education_programs.root, localized: true),
label: Education::Program.model_name.human,
include_blank: false %>
</div>
<div class="d-none"
data-conditional-source="about_type"
data-conditional-value="Research::Journal">
<%= f.input :about_id,
collection: osuny_collection(current_university.research_journals, localized: true),
label: Research::Journal.model_name.human,
include_blank: false %>
</div>
<div class="d-none"
data-conditional-source="about_type"
data-conditional-value="Research::Laboratory">
<%= f.input :about_id,
collection: osuny_collection(current_university.research_laboratories, localized: true),
label: Research::Laboratory.model_name.human,
include_blank: false %>
</div>