Class: Layout::GridComponent
- Inherits:
-
SparkComponents::Component
- Object
- SparkComponents::Component
- Layout::GridComponent
- Defined in:
- app/components/spark/layout/grid_component.rb
Instance Method Summary collapse
Instance Method Details
#after_init ⇒ Object
12 13 14 |
# File 'app/components/spark/layout/grid_component.rb', line 12 def after_init @span = 12 / @cols if @cols end |
#before_render ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/components/spark/layout/grid_component.rb', line 16 def before_render add_class(join_class("gutter-#{gutter}")) if gutter add_class(join_class("gutter-#{gutter}-match")) if gutter && gutter_match data_attr column_min: min data_attr column_break: @break add_class join_class("no-wrap") unless wrap add_class join_class("reverse") if reverse end |
#render ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/components/spark/layout/grid_component.rb', line 25 def render content_tag(:div, tag_attrs) do concat content_tag(:div, class: join_class("columns")) { columns.each { |column| concat column } } end end |