Class: AhoyCaptain::DropdownLinkComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- AhoyCaptain::DropdownLinkComponent
- Defined in:
- app/components/ahoy_captain/dropdown_link_component.rb
Instance Method Summary collapse
-
#initialize(title:, classes: nil) ⇒ DropdownLinkComponent
constructor
A new instance of DropdownLinkComponent.
- #link_to(name, url, **options) ⇒ Object
Constructor Details
#initialize(title:, classes: nil) ⇒ DropdownLinkComponent
Returns a new instance of DropdownLinkComponent.
7 8 9 10 |
# File 'app/components/ahoy_captain/dropdown_link_component.rb', line 7 def initialize(title:, classes: nil) @title = title @classes = classes end |
Instance Method Details
#link_to(name, url, **options) ⇒ Object
12 13 14 |
# File 'app/components/ahoy_captain/dropdown_link_component.rb', line 12 def link_to(name, url, **) self.with_option_content view_context.link_to name, url, end |