Class: AhoyCaptain::DropdownLinkComponent

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

Instance Method Summary collapse

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



12
13
14
# File 'app/components/ahoy_captain/dropdown_link_component.rb', line 12

def link_to(name, url, **options)
  self.with_option_content view_context.link_to name, url, options
end