Class: EasyAdmin::Fields::Show::EmailComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/easy_admin/fields/show/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
14
15
# File 'app/components/easy_admin/fields/show/email_component.rb', line 5

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