Module: Sidebars::Concerns::ContainerWithHtmlOptions
- Includes:
- LinkWithHtmlOptions
- Included in:
- Menu
- Defined in:
- lib/sidebars/concerns/container_with_html_options.rb
Instance Method Summary collapse
-
#collapsed_container_html_options ⇒ Object
The attributes returned from this method will be applied to helper methods like ‘link_to` or the div containing the container when it is collapsed.
-
#container_html_options ⇒ Object
The attributes returned from this method will be applied to helper methods like ‘link_to` or the div containing the container.
-
#extra_collapsed_container_html_options ⇒ Object
Classes should mostly override this method and not ‘collapsed_container_html_options`.
-
#extra_container_html_options ⇒ Object
Classes will override mostly this method and not ‘container_html_options`.
-
#extra_nav_link_html_options ⇒ Object
Classes should mostly override this method and not ‘nav_link_html_options`.
- #link ⇒ Object
-
#nav_link_html_options ⇒ Object
Attributes to pass to the html_options attribute in the helper method that sets the active class on each element.
- #title ⇒ Object
-
#title_html_options ⇒ Object
The attributes returned from this method will be applied right next to the title, for example in the span that renders the title.
Methods included from LinkWithHtmlOptions
Instance Method Details
#collapsed_container_html_options ⇒ Object
The attributes returned from this method will be applied to helper methods like ‘link_to` or the div containing the container when it is collapsed.
27 28 29 30 31 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 27 def { aria: { label: title } }.merge() end |
#container_html_options ⇒ Object
The attributes returned from this method will be applied to helper methods like ‘link_to` or the div containing the container.
11 12 13 14 15 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 11 def { aria: { label: title } }.merge() end |
#extra_collapsed_container_html_options ⇒ Object
Classes should mostly override this method and not ‘collapsed_container_html_options`.
35 36 37 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 35 def {} end |
#extra_container_html_options ⇒ Object
Classes will override mostly this method and not ‘container_html_options`.
19 20 21 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 19 def {} end |
#extra_nav_link_html_options ⇒ Object
Classes should mostly override this method and not ‘nav_link_html_options`.
52 53 54 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 52 def {} end |
#link ⇒ Object
67 68 69 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 67 def link raise NotImplementedError end |
#nav_link_html_options ⇒ Object
Attributes to pass to the html_options attribute in the helper method that sets the active class on each element.
42 43 44 45 46 47 48 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 42 def { data: { track_label: self.class.name.demodulize.underscore } }.deep_merge() end |
#title ⇒ Object
56 57 58 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 56 def title raise NotImplementedError end |
#title_html_options ⇒ Object
The attributes returned from this method will be applied right next to the title, for example in the span that renders the title.
63 64 65 |
# File 'lib/sidebars/concerns/container_with_html_options.rb', line 63 def {} end |