Module: CommonFunctions::ViewHelpers

Defined in:
lib/common_functions/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#btn_dangerObject



19
20
21
# File 'lib/common_functions/view_helpers.rb', line 19

def btn_danger
  "btn btn-danger"
end

#btn_danger_smObject



23
24
25
# File 'lib/common_functions/view_helpers.rb', line 23

def btn_danger_sm
  "btn btn-danger btn-sm"
end

#btn_primaryObject



3
4
5
# File 'lib/common_functions/view_helpers.rb', line 3

def btn_primary
  "btn btn-primary"
end

#btn_primary_smObject



7
8
9
# File 'lib/common_functions/view_helpers.rb', line 7

def btn_primary_sm
  "btn btn-primary btn-sm"
end

#btn_successObject



11
12
13
# File 'lib/common_functions/view_helpers.rb', line 11

def btn_success
  "btn btn-success"
end

#btn_success_smObject



15
16
17
# File 'lib/common_functions/view_helpers.rb', line 15

def btn_success_sm
  "btn btn-success btn-sm"
end

#form_controlObject



55
56
57
# File 'lib/common_functions/view_helpers.rb', line 55

def form_control
  "form-control"
end


27
28
29
# File 'lib/common_functions/view_helpers.rb', line 27

def print_date(timestamp)
  timestamp.strftime("%F")
end


31
32
33
# File 'lib/common_functions/view_helpers.rb', line 31

def print_date_time(timestamp)
  timestamp.strftime("%F %T")
end

#table_borderedObject



35
36
37
# File 'lib/common_functions/view_helpers.rb', line 35

def table_bordered
  "<table class='table table-bordered'>".html_safe
end

#table_bordered_stripedObject



43
44
45
# File 'lib/common_functions/view_helpers.rb', line 43

def table_bordered_striped
  "<table class='table table-bordered table-striped'>".html_safe
end

#table_head(name) ⇒ Object



47
48
49
# File 'lib/common_functions/view_helpers.rb', line 47

def table_head(name)
  "<th>#{name}</th>".html_safe
end

#table_row_name_value(name, value) ⇒ Object



51
52
53
# File 'lib/common_functions/view_helpers.rb', line 51

def table_row_name_value(name, value)
  "<tr><td>#{name}</td><td>#{value}</td></tr>".html_safe
end

#table_stripedObject



39
40
41
# File 'lib/common_functions/view_helpers.rb', line 39

def table_striped
  "<table class='table table-striped'>".html_safe
end