Class: Uchi::Ui::Navigation::SearchLink
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Uchi::Ui::Navigation::SearchLink
- Includes:
- RoutesHelper
- Defined in:
- app/components/uchi/ui/navigation/search_link.rb
Overview
Renders the icon link to the search page shown in the main navigation.
Instance Attribute Summary collapse
-
#html_class ⇒ Object
readonly
Returns the value of attribute html_class.
Instance Method Summary collapse
-
#initialize(html_class: nil) ⇒ SearchLink
constructor
A new instance of SearchLink.
- #label ⇒ Object
- #path ⇒ Object
- #render? ⇒ Boolean
Methods included from RoutesHelper
Constructor Details
#initialize(html_class: nil) ⇒ SearchLink
Returns a new instance of SearchLink.
13 14 15 16 |
# File 'app/components/uchi/ui/navigation/search_link.rb', line 13 def initialize(html_class: nil) super() @html_class = html_class end |
Instance Attribute Details
#html_class ⇒ Object (readonly)
Returns the value of attribute html_class.
11 12 13 |
# File 'app/components/uchi/ui/navigation/search_link.rb', line 11 def html_class @html_class end |
Instance Method Details
#label ⇒ Object
18 19 20 |
# File 'app/components/uchi/ui/navigation/search_link.rb', line 18 def label Uchi::I18n.translate("search.label", default: "Search") end |
#path ⇒ Object
22 23 24 |
# File 'app/components/uchi/ui/navigation/search_link.rb', line 22 def path uchi_path_to(:search) end |
#render? ⇒ Boolean
26 27 28 |
# File 'app/components/uchi/ui/navigation/search_link.rb', line 26 def render? Uchi::Repository.any_searchable? end |