Sha256: b0376bf75848f6a636fc8442b6444b3f6de0fc7e6fb4139c737ed919f1eeedf3
Contents?: true
Size: 1.17 KB
Versions: 31
Compression:
Stored size: 1.17 KB
Contents
- if object.class.show_associations.map(&:to_s).include? association.name.to_s - association_type = association.class.to_s.split('::').last.sub(/Reflection$/, '').underscore.to_sym %tr %td = model_class.human_attribute_name association.name %hr - if association_type != :has_one || !object.send(association.name).present? = link_to "#{I18n.t('helpers.actions.add')} #{model_class.human_attribute_name(association.name).singularize.downcase}", new_associated_record_path(association: association, object: object, as: object.send("#{association.name}_as")), class: 'btn btn-primary' %td{ colspan: 2 } - if association_type.in? [ :has_one, :belongs_to ] %table.table.table-striped.table-bordered = render 'tramway/admin/shared/show/associations/table_row', object: object, association: association, association_object: object.send(association.name) - else %table.table.table-striped.table-bordered - object.send(association.name)&.each do |association_object| = render 'tramway/admin/shared/show/associations/table_row', object: object, association: association, association_object: association_object
Version data entries
31 entries across 31 versions & 1 rubygems