This commit is contained in:
rulingcom 2025-05-15 23:34:30 +08:00
parent 5357306c92
commit de407b718f
2 changed files with 8 additions and 3 deletions

View File

@ -7,7 +7,12 @@ class CurationPostSection
field :section_type
field :text, localize: true
field :universal_table
field :table_entries, type: Array, default: []
field :table_entries
belongs_to :curation_post
def get_table_entries
tids = self.table_entries.split(',')
TableEntry.find(tids)
end
end

View File

@ -38,7 +38,7 @@
<span class="tab-content section_type">
<span class="add-on"><%= t("curation.section_type") %></span>
<%= f.select :section_type, CurationPost::SECTION_TYPES.map { |type| [t("curation.#{type}"), type] },
{ include_blank: t("curation.please_select") },
{ include_blank: t("curation.please_select"), selected: form_section_post.section_type },
class: 'form-control' %>
</span>
@ -55,7 +55,7 @@
<% if defined? UniversalTable %>
<span class="tab-content section_type_ut" style="display:none">
<span class="add-on"><%= t("curation.tables") %></span>
<%= f.select :section_type, UTable.all.map { |table| [table.title, table.uid] },
<%= f.select :universal_table, UTable.all.map { |table| [table.title, table.uid] },
{ include_blank: t("curation.please_select") },
class: 'form-control' %>
</span>