Class: Ui::Buttons::Base

Inherits:
Component
  • Object
show all
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



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

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

#editObject



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

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

#newObject



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

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

#showObject



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

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