Sha256: 7f2895a6fd0e5043b756b32f1a8fa697e24253d6d29f10c787431aaa29d9a5ad

Contents?: true

Size: 872 Bytes

Versions: 42

Compression:

Stored size: 872 Bytes

Contents

:ruby
  tr_prefix = if resource.respond_to?(:to_key)
    dom_id(resource)
  else
    "#{resource.class.name.underscore.gsub('/', '-')}-#{resource.object_id}"
  end
%table{ class: table_css_classes, id: "#{tr_prefix}-resource-table" }
  - rows.each do |name, options|
    %tr{ class: "attribute-#{name}", id: "#{tr_prefix}-#{name}"}
      - if resource_class.respond_to? :human_attribute_name
        %th{ class: 'attribute-name' }
          = resource_class.human_attribute_name(name)
      - else
        %th{ class: 'attribute-name' }
          = name
      - if options[:block].present?
        %td{ class: 'attribute-value' }
          = options[:block].call(resource)
      - else
        %td{ class: 'attribute-value' }
          = render partial: "rao/component/table/body_cells/#{options[:render_as]}", locals: { resource: resource, name: name, options: options }

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
rao-component-0.0.49.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.48.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.47.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.46.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.45.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.44.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.43.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.42.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.41.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.40.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.39.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.38.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.37.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.36.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.35.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.34.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.33.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.32.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.31.pre app/views/rao/component/_resource_table.html.haml
rao-component-0.0.30.pre app/views/rao/component/_resource_table.html.haml