Module: CommonFunctions::ViewHelpers
- Defined in:
- lib/common_functions/view_helpers.rb
Instance Method Summary collapse
- #btn_danger ⇒ Object
- #btn_danger_sm ⇒ Object
- #btn_primary ⇒ Object
- #btn_primary_sm ⇒ Object
- #btn_success ⇒ Object
- #btn_success_sm ⇒ Object
- #form_control ⇒ Object
- #print_date(timestamp) ⇒ Object
- #print_date_time(timestamp) ⇒ Object
- #table_bordered ⇒ Object
- #table_bordered_striped ⇒ Object
- #table_head(name) ⇒ Object
- #table_row_name_value(name, value) ⇒ Object
- #table_striped ⇒ Object
Instance Method Details
#btn_danger ⇒ Object
19 20 21 |
# File 'lib/common_functions/view_helpers.rb', line 19 def btn_danger "btn btn-danger" end |
#btn_danger_sm ⇒ Object
23 24 25 |
# File 'lib/common_functions/view_helpers.rb', line 23 def btn_danger_sm "btn btn-danger btn-sm" end |
#btn_primary ⇒ Object
3 4 5 |
# File 'lib/common_functions/view_helpers.rb', line 3 def btn_primary "btn btn-primary" end |
#btn_primary_sm ⇒ Object
7 8 9 |
# File 'lib/common_functions/view_helpers.rb', line 7 def btn_primary_sm "btn btn-primary btn-sm" end |
#btn_success ⇒ Object
11 12 13 |
# File 'lib/common_functions/view_helpers.rb', line 11 def btn_success "btn btn-success" end |
#btn_success_sm ⇒ Object
15 16 17 |
# File 'lib/common_functions/view_helpers.rb', line 15 def btn_success_sm "btn btn-success btn-sm" end |
#form_control ⇒ Object
55 56 57 |
# File 'lib/common_functions/view_helpers.rb', line 55 def form_control "form-control" end |
#print_date(timestamp) ⇒ Object
27 28 29 |
# File 'lib/common_functions/view_helpers.rb', line 27 def print_date() .strftime("%F") end |
#print_date_time(timestamp) ⇒ Object
31 32 33 |
# File 'lib/common_functions/view_helpers.rb', line 31 def print_date_time() .strftime("%F %T") end |
#table_bordered ⇒ Object
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_striped ⇒ Object
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_striped ⇒ Object
39 40 41 |
# File 'lib/common_functions/view_helpers.rb', line 39 def table_striped "<table class='table table-striped'>".html_safe end |