Class: PandaCms::GridComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/panda_cms/grid_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(columns: 1, spans: [1]) ⇒ GridComponent

Returns a new instance of GridComponent.



5
6
7
8
9
10
11
# File 'app/components/panda_cms/grid_component.rb', line 5

def initialize(columns: 1, spans: [1])
  @columns = "grid-cols-#{columns}"
  @colspans = []
  spans.each do |span|
    @colspans << "col-span-#{span}"
  end
end