Sha256: f00f49694266a9770aa39f8809e864cc0fb801ec534185be8fcfc4c7d1462ef1
Contents?: true
Size: 1.35 KB
Versions: 12
Compression:
Stored size: 1.35 KB
Contents
- if object.class.show_associations.nil? = "Please, fill show associations method in decorator" - else - 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 create_is_available?(association.class_name) && (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
12 entries across 12 versions & 1 rubygems