Class: AhoyCaptain::TileComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/ahoy_captain/tile_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(title: nil, wide: false, classes: "p-8 mx-4") ⇒ TileComponent

Returns a new instance of TileComponent.



8
9
10
11
12
# File 'app/components/ahoy_captain/tile_component.rb', line 8

def initialize(title: nil, wide: false, classes: "p-8 mx-4")
  @classes = classes
  @title = title
  @wide = wide
end

Instance Method Details



14
15
16
17
18
19
# File 'app/components/ahoy_captain/tile_component.rb', line 14

def link_to(name, url, **options)
  options[:class] = "inline-block h-5 font-semibold"
  options[:data] ||= {}
  options[:data].merge!(controller: "frame-link")
  view_context.link_to name, url, **options
end