Module: Trestle::GridHelper
- Defined in:
- app/helpers/trestle/grid_helper.rb
Instance Method Summary collapse
Instance Method Details
#col(columns = nil, breakpoints = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/trestle/grid_helper.rb', line 7 def col(columns=nil, breakpoints={}) if columns.is_a?(Hash) breakpoints = columns columns = breakpoints.delete("xs") || breakpoints.delete(:xs) end classes = [] classes << (columns ? "col-#{columns}" : "col") classes += breakpoints.map { |breakpoint, span| "col-#{breakpoint}-#{span}" } content_tag(:div, class: classes) { yield } end |
#divider ⇒ Object
20 21 22 |
# File 'app/helpers/trestle/grid_helper.rb', line 20 def divider content_tag(:hr) end |
#row ⇒ Object
3 4 5 |
# File 'app/helpers/trestle/grid_helper.rb', line 3 def row content_tag(:div, class: "row") { yield } end |