activescaffold/active_scaffold

View on GitHub
app/views/active_scaffold_overrides/_horizontal_subform_header.html.erb

Summary

Maintainability
Test Coverage
<thead>
  <tr>
    <%
    columns ||= active_scaffold_config_for(record_class).subform.columns
    columns.each_column(for: record_class, crud_type: :read) do |column|
      next unless column.is_a? ActiveScaffold::DataStructures::Column
      next unless in_subform?(column, parent_record, parent_column)
      hidden = column_renders_as(column) == :hidden
      -%>
      <th class="<%= "#{column.name}-column #{'required' if column.required?} #{'hidden' if hidden}" %>">
        <label><%= subform_label(column, hidden) %></label>
        <% if column.description.present? -%>
          <span class="description"><%= column.description %></span>
        <% end -%>
      </th>
    <% end -%>
    <th></th>
  </tr>
</thead>