Module: CornStarch::ModalHelper

Defined in:
app/helpers/corn_starch/modal_helper.rb

Overview

Modal Helper

Instance Method Summary collapse

Instance Method Details

Modal Block Tag



33
34
35
36
37
# File 'app/helpers/corn_starch/modal_helper.rb', line 33

def modal_block_tag
  div_tag class: 'modal-block' do
    yield if block_given?
  end
end

Hide Button Tag



28
29
30
# File 'app/helpers/corn_starch/modal_helper.rb', line 28

def modal_hide_btn_tag modal
  div_tag '✖'.html_safe, class: 'modal-close-btn', id: "#{modal_name modal[:name]}-btn-hide"
end

Modal Name



18
19
20
# File 'app/helpers/corn_starch/modal_helper.rb', line 18

def modal_name name
  "modal-#{name}"
end

Show Button ID



23
24
25
# File 'app/helpers/corn_starch/modal_helper.rb', line 23

def modal_show_btn_id name
  "#{modal_name name}-btn-show"
end

Modal Tag



11
12
13
14
15
# File 'app/helpers/corn_starch/modal_helper.rb', line 11

def modal_tag params
  render layout: 'corn_starch/layouts/modal', locals: { modal: params } do
    yield params if block_given?
  end
end