Module: RailsTheme::Bootstrap::ModalHelper

Defined in:
app/helpers/rails_theme/bootstrap/modal_helper.rb

Instance Method Summary collapse

Instance Method Details



43
44
45
46
47
48
49
# File 'app/helpers/rails_theme/bootstrap/modal_helper.rb', line 43

def link_to_close_button
  options = {
    data: { dismiss: 'modal' },
    class: 'btn'
  }
  link_to t('helpers.close'), '#', options
end


30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/helpers/rails_theme/bootstrap/modal_helper.rb', line 30

def link_to_edit_modal url, modal_id, options = {}
  options = {
    remote: true,
    data: {
      toggle: 'modal',
      target: modal_id,
      type: 'html'
    },
    class: 'modal-open btn'
  }.deep_merge options
  link_to_edit url, options
end


4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/rails_theme/bootstrap/modal_helper.rb', line 4

def link_to_modal text, url, modal_id, options = {}
  options = {
    remote: true,
    data: {
      toggle: 'modal',
      target: modal_id,
      type: 'html'
    },
    class: 'modal-open'
  }.deep_merge options
  link_to text, url, options
end


17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/helpers/rails_theme/bootstrap/modal_helper.rb', line 17

def link_to_open_modal text, url, modal_id, options = {}
  options = {
    remote: true,
    data: {
      toggle: 'modal',
      target: modal_id,
      type: 'html'
    },
    class: 'modal-open'
  }.deep_merge options
  iconed_link_to text, url, options
end


51
52
53
54
55
56
57
58
59
# File 'app/helpers/rails_theme/bootstrap/modal_helper.rb', line 51

def modal_close_button
  options = {
    type: 'button',
    name: nil,
    data: { dismiss: 'modal' },
    class: 'close'
  }
  button_tag 'x', options
end