Class: EasyAdmin::Fields::Index::EmailComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/easy_admin/fields/index/email_component.rb

Instance Attribute Summary

Attributes inherited from BaseComponent

#field, #form, #record, #value

Instance Method Summary collapse

Methods inherited from BaseComponent

#easy_admin_url_helpers, #helpers, #initialize, #rails_url_helpers

Methods included from EasyAdmin::FieldsHelper

#field_component, #render_field

Methods included from DashboardsHelper

#delta_badge_classes, #metric_value_classes, #render_card, #sparkline_color, #sparkline_points, #trend_direction, #trend_icon, #trend_indicator_classes

Constructor Details

This class inherits a constructor from EasyAdmin::Fields::BaseComponent

Instance Method Details

#view_templateObject



5
6
7
8
9
10
11
12
13
# File 'app/components/easy_admin/fields/index/email_component.rb', line 5

def view_template
  if value.present?
    a(href: "mailto:#{value}", class: "ea-link") do
      truncate(value.to_s, length: 30)
    end
  else
    span(class: "ea-empty-value") { "" }
  end
end