Class: AhoyCaptain::TileComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- AhoyCaptain::TileComponent
- Defined in:
- app/components/ahoy_captain/tile_component.rb
Instance Method Summary collapse
-
#initialize(title: nil, wide: false, classes: "p-8 mx-4") ⇒ TileComponent
constructor
A new instance of TileComponent.
- #link_to(name, url, **options) ⇒ Object
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
#link_to(name, url, **options) ⇒ Object
14 15 16 17 18 19 |
# File 'app/components/ahoy_captain/tile_component.rb', line 14 def link_to(name, url, **) [:class] = "inline-block h-5 font-semibold" [:data] ||= {} [:data].merge!(controller: "frame-link") view_context.link_to name, url, ** end |