Class: Ui::Buttons::Base

Inherits:
Component
  • Object
show all
Includes:
Stylable
Defined in:
lib/ui/buttons/base.rb

Direct Known Subclasses

Primary, Secondary, Tertiary

Constant Summary

Constants inherited from Component

Component::VIEWPATH

Instance Method Summary collapse

Methods inherited from Component

#capture, #render_group

Instance Method Details

#destroyObject



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ui/buttons/base.rb', line 30

def destroy
  display(
    text_with_icon(destroy_icon),
    path,
    button_options.merge({
      method: :delete,
      data: {
        confirm: 'Are you sure?'
      }
    }),
  )
end

#editObject



22
23
24
25
26
27
28
# File 'lib/ui/buttons/base.rb', line 22

def edit
  display(
    text_with_icon(edit_icon),
    path,
    button_options
  )
end

#emailObject



51
52
53
54
55
56
57
# File 'lib/ui/buttons/base.rb', line 51

def email
  mail_to(
    path,
    text_with_icon(email_icon),
    button_options
  )
end

#newObject



14
15
16
17
18
19
20
# File 'lib/ui/buttons/base.rb', line 14

def new
  display(
    text_with_icon(new_icon),
    path,
    button_options
  )
end

#phoneObject



43
44
45
46
47
48
49
# File 'lib/ui/buttons/base.rb', line 43

def phone
  display(
    text_with_icon(phone_icon),
    "tel:#{path}",
    button_options
  )
end

#showObject



6
7
8
9
10
11
12
# File 'lib/ui/buttons/base.rb', line 6

def show
  display(
    text_with_icon(icon),
    path,
    button_options,
  )
end