Module: Blot::Helpers::Grid
- Included in:
- Blot::Helpers
- Defined in:
- lib/blot/helpers/grid.rb
Instance Method Summary collapse
- #columns(width, options = {}, &block) ⇒ Object (also: #column)
- #container(options = {}, &block) ⇒ Object
- #row(&block) ⇒ Object
- #wrapper(options = {}, &block) ⇒ Object
Instance Method Details
#columns(width, options = {}, &block) ⇒ Object Also known as: column
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/blot/helpers/grid.rb', line 32 def columns(width, ={}, &block) content_tag :table, class: "#{width} columns" do content_tag :tr do content_tag :td, do if block_given? [:class] == 'center' ? content_tag(:center, yield) : yield end end content_tag :td, class: 'expander' end end end |
#container(options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/blot/helpers/grid.rb', line 4 def container(={}, &block) content_tag :table, class: 'container' do content_tag :tr do content_tag :td, do [:class] == 'center' ? content_tag(:center, yield) : yield end end end end |
#row(&block) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/blot/helpers/grid.rb', line 14 def row(&block) content_tag :table, class: 'row' do content_tag :tr do yield if block_given? end end end |
#wrapper(options = {}, &block) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/blot/helpers/grid.rb', line 22 def wrapper(={}, &block) content_tag :td, do if block_given? [:class] == 'center' ? content_tag(:center, yield) : yield end end end |