Module: Binco::ButtonHelper

Defined in:
app/helpers/binco/button_helper.rb

Instance Method Summary collapse

Instance Method Details

#button(title, options = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/binco/button_helper.rb', line 3

def button(title, options = {})
  options[:type] ||= :default
  options[:class] ||= ''
  options[:class] << ' ' if options[:class].length > 1
  options[:class] << "btn btn-#{options[:type]}"
   :button, title, options.except(:type)
end

#button_danger(title, options = {}) ⇒ Object



36
37
38
39
# File 'app/helpers/binco/button_helper.rb', line 36

def button_danger(title, options = {})
  options[:type] = :warning
  button(title, options)
end

#button_default(title, options = {}) ⇒ Object



16
17
18
19
# File 'app/helpers/binco/button_helper.rb', line 16

def button_default(title, options = {})
  options[:type] = :default
  button(title, options)
end

#button_info(title, options = {}) ⇒ Object



26
27
28
29
# File 'app/helpers/binco/button_helper.rb', line 26

def button_info(title, options = {})
  options[:type] = :info
  button(title, options)
end

#button_primary(title, options = {}) ⇒ Object



11
12
13
14
# File 'app/helpers/binco/button_helper.rb', line 11

def button_primary(title, options = {})
  options[:type] = :primary
  button(title, options)
end

#button_success(title, options = {}) ⇒ Object



21
22
23
24
# File 'app/helpers/binco/button_helper.rb', line 21

def button_success(title, options = {})
  options[:type] = :default
  button(title, options)
end

#button_warning(title, options = {}) ⇒ Object



31
32
33
34
# File 'app/helpers/binco/button_helper.rb', line 31

def button_warning(title, options = {})
  options[:type] = :warning
  button(title, options)
end