Module: PhantomHelpers::ViewHelpers::TableHelper
- Defined in:
- lib/phantom_helpers/view_helpers/table_helper.rb
Instance Method Summary collapse
- #show_table(&block) ⇒ Object
- #show_table_for(id, &block) ⇒ Object
- #sortable_table_for(id, &block) ⇒ Object
- #table(&block) ⇒ Object
- #table_for(id, &block) ⇒ Object
- #th(text) ⇒ Object
- #th_actions(num) ⇒ Object
- #th_icon(icon) ⇒ Object
Instance Method Details
#show_table(&block) ⇒ Object
31 32 33 34 35 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 31 def show_table(&block) content_tag :table, class: "table table-hover table-condensed" do block.call end end |
#show_table_for(id, &block) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 21 def show_table_for(id, &block) content_tag :div, class: "row" do content_tag :div, class: "col-md-12" do content_tag :table, class: "table", id: id do block.call end end end end |
#sortable_table_for(id, &block) ⇒ Object
37 38 39 40 41 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 37 def sortable_table_for(id, &block) content_tag :table, class: "table table-striped table-bordered table-condensed", id: id do block.call end end |
#table(&block) ⇒ Object
15 16 17 18 19 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 15 def table(&block) content_tag :table, class: "table table-striped table-bordered table-condensed" do block.call end end |
#table_for(id, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 5 def table_for(id, &block) content_tag :div, class: "row" do content_tag :div, class: "col-md-12" do content_tag :table, class: "table table-striped table-bordered table-condensed", id: id do block.call end end end end |
#th(text) ⇒ Object
43 44 45 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 43 def th(text) content_tag(:th, class: "btn-inverse") { text } end |
#th_actions(num) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 53 def th_actions(num) size = case num when 1 then 35 when 2 then 64 when 3 then 93 else num end content_tag :th, class: "btn-inverse", style:"width:#{size}px" do content_tag :span, nil, class: "glyphicon glyphicon-edit" end end |
#th_icon(icon) ⇒ Object
47 48 49 50 51 |
# File 'lib/phantom_helpers/view_helpers/table_helper.rb', line 47 def th_icon(icon) content_tag :th, class: "btn-inverse", style: "width:24px;" do content_tag :span, nil, class: "glyphicon glyphicon-#{icon}" end end |