Class: FoxTail::BreadcrumbComponent

Inherits:
BaseComponent show all
Defined in:
app/components/fox_tail/breadcrumb_component.rb

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from BaseComponent

classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

This class inherits a constructor from FoxTail::BaseComponent

Instance Method Details

#before_renderObject



82
83
84
85
86
87
88
89
# File 'app/components/fox_tail/breadcrumb_component.rb', line 82

def before_render
  super

  with_separator_icon :chevron_right unless separator?

  html_attributes[:aria] ||= {}
  html_attributes[:aria][:label] = t("components.fox_tail.breadcrumb.label", default: "Breadcrumbs")
end

#callObject



91
92
93
94
95
96
# File 'app/components/fox_tail/breadcrumb_component.rb', line 91

def call
   :nav, html_attributes do
    concat render_list
    concat content if content?
  end
end

#render?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'app/components/fox_tail/breadcrumb_component.rb', line 78

def render?
  items?
end