/ This view renders the attributes defined on the record's class collection
/ This is meant to be a good default when no specific logic is required
- record.collection_class.attributes.each do |attribute, options|
  - column = record.class.columns_hash[attribute]
  - if attribute.ends_with?('_id') && association_options = record.class.reflect_on_association(attribute.sub(/_id$/, '')) #UGLY BUT EFFECTIVE
    - if association = record.public_send(association_options.name)
      .display-row class="attribute-#{association_options.name}"
        .display-label= association.class.model_name.human
        .display-field
          - display_value = association.attributes.slice('name', 'title').values.first || attribute.sub(/_id$/, '')
          - if path = polymorphic_path([main_app, association]) rescue nil # might not have a show path
            = link_to display_value, path
          - else
            = display_value
  - elsif column.type == :text
    .display-row class="attribute-#{attribute}"
      .display-label= record.class.human_attribute_name(attribute)
      pre.badge-info-text.display-field= record.public_send(attribute)
  - elsif column.type == :boolean
    .display-row class="attribute-#{attribute}"
      .display-label= record.class.human_attribute_name(attribute)
      .display-field= boolean_show record.public_send(attribute)
  - elsif column.type == :date
    .display-row class="attribute-#{attribute}"
      .display-label= record.class.human_attribute_name(attribute)
      .display-field= dunlop_localize record.public_send(attribute)
  - else
    .display-row class="attribute-#{attribute}"
      .display-label= record.class.human_attribute_name(attribute)
      .display-field= record.public_send(attribute)
