Class: NfgUi::Components::Elements::NavItem
- Inherits:
-
Bootstrap::Components::NavItem
- Object
- Bootstrap::Components::Base
- Bootstrap::Components::NavItem
- NfgUi::Components::Elements::NavItem
- Includes:
- Bootstrap::Utilities::Tooltipable, Traits::Active, Traits::Disable, Traits::NavItem, Traits::Remote, Utilities::Describable, Utilities::Iconable, Utilities::Renderable, Utilities::Traitable
- Defined in:
- lib/nfg_ui/components/elements/nav_item.rb
Overview
Nav doc coming soon
Direct Known Subclasses
Constant Summary
Constants included from Traits::Remote
Constants included from Traits::NavItem
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 included from Bootstrap::Utilities::Wrappable
Attributes inherited from Bootstrap::Components::Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Traits::Remote
Methods included from Traits::NavItem
Methods included from Traits::Disable
Methods included from Traits::Active
Methods included from Utilities::Traitable
Methods included from Utilities::Renderable
Methods included from Utilities::Describable
Methods included from Utilities::Iconable
Methods included from Bootstrap::Utilities::Tooltipable
#data, #disabled_component_tooltip_wrapper_html_options, #html_options, #tooltip
Methods included from Bootstrap::Utilities::Disableable
Methods inherited from Bootstrap::Components::NavItem
#active, #button, #component_family, #disabled, #dropdown, #html_options, #include_nav_link?, #remote, #tab
Methods included from Bootstrap::Utilities::Wrappable
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
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/nfg_ui/components/elements/nav_item.rb', line 20 def render content_tag(as, ) do if include_nav_link? concat(NfgUi::Components::Elements::NavLink.new({ body: ( ? : (block_given? ? yield : body)), active: active, disabled: disabled, dropdown: dropdown, tab: tab, remote: remote, href: (tab || href), icon: icon }, view_context).render) if dropdown concat(block_given? ? yield : body) end else 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 |