Class: NfgUi::Components::Elements::NavLink
- Inherits:
-
Bootstrap::Components::NavLink
- Object
- Bootstrap::Components::Base
- Bootstrap::Components::NavLink
- NfgUi::Components::Elements::NavLink
- Includes:
- Bootstrap::Utilities::CollapseToggleable, Bootstrap::Utilities::Modalable, Traits::Active, Traits::Disable, Traits::Remote, Utilities::Describable, Utilities::Iconable, Utilities::Methodable, Utilities::Renderable, Utilities::Traitable
- Defined in:
- lib/nfg_ui/components/elements/nav_link.rb
Overview
Nav doc coming soon
Direct Known Subclasses
Constant Summary
Constants included from Traits::Remote
Constants included from Traits::Disable
Constants included from Traits::Active
Constants included from Traits
Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES
Instance Attribute Summary
Attributes included from Bootstrap::Utilities::Disableable
Attributes inherited from Bootstrap::Components::Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Traits::Remote
Methods included from Traits::Disable
Methods included from Traits::Active
Methods included from Utilities::Renderable
Methods included from Utilities::Methodable
Methods included from Utilities::Iconable
Methods included from Utilities::Describable
Methods included from Utilities::Traitable
Methods included from Bootstrap::Utilities::Modalable
Methods included from Bootstrap::Utilities::CollapseToggleable
Methods included from Bootstrap::Utilities::Collapsible
#collapse, #collapsed, #collapsible
Methods inherited from Bootstrap::Components::NavLink
#component_family, #data, #dropdown, #tab
Methods included from Bootstrap::Utilities::Remotable
Methods included from Bootstrap::Utilities::Disableable
Methods included from Bootstrap::Utilities::Activatable
Methods inherited from Bootstrap::Components::Base
#component_family, #data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#render ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/nfg_ui/components/elements/nav_link.rb', line 21 def render # Do NOT use :collapse while also using dropdown. That would be # self-defeating. Since a dropdown menu is a more specific type # of collapse component. if dropdown NfgUi::Components::Elements::DropdownToggle.new({ body: (block_given? ? yield : body), as: :a, **, theme: nil, nav_link: true }, view_context).render else content_tag(:a, ) do if icon NfgUi::Components::Foundations::Icon.new({ traits: [icon], text: (block_given? ? yield : body) }, view_context).render else (block_given? ? yield : body) end end end end |