Class: Ui::Buttons::Base
Constant Summary
Constants inherited
from Component
Component::VIEWPATH
Instance Method Summary
collapse
Methods inherited from Component
#capture, #render_group
Instance Method Details
#destroy ⇒ Object
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
|
#edit ⇒ Object
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
|
#email ⇒ Object
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
|
#new ⇒ Object
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
|
#phone ⇒ Object
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
|
#show ⇒ Object
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
|