Module: Binco::ButtonLinkHelper

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

Instance Method Summary collapse

Instance Method Details



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

def button_danger_link_to(name = nil, options = nil, html_options = {}, &block)
  html_options[:type] = :danger
  button_link_to(name, options, html_options, &block)
end


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

def button_default_link_to(name = nil, options = nil, html_options = {}, &block)
  html_options[:type] = :default
  button_link_to(name, options, html_options, &block)
end


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

def button_info_link_to(name = nil, options = nil, html_options = {}, &block)
  html_options[:type] = :info
  button_link_to(name, options, html_options, &block)
end


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

def button_link_to(name = nil, options = nil, html_options = {}, &block)
  html_options[:type] ||= :default
  html_options[:class] ||= ''
  html_options[:class] << ' ' if html_options[:class].length > 1
  html_options[:class] << "btn btn-#{html_options[:type]}"
  link_to(name, options, html_options.except(:type), &block)
end


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

def button_primary_link_to(name = nil, options = nil, html_options = {}, &block)
  html_options[:type] = :primary
  button_link_to(name, options, html_options, &block)
end


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

def button_success_link_to(name = nil, options = nil, html_options = {}, &block)
  html_options[:type] = :success
  button_link_to(name, options, html_options, &block)
end


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

def button_warning_link_to(name = nil, options = nil, html_options = {}, &block)
  html_options[:type] = :warning
  button_link_to(name, options, html_options, &block)
end