Class: NfgUi::Bootstrap::Components::NavLink
Overview
Instance Attribute Summary
#as
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary
collapse
#remote
#disabled
#active
Methods inherited from Base
#href, #html_options, #id, #initialize, #style
Instance Method Details
#component_family ⇒ Object
13
14
15
|
# File 'lib/nfg_ui/bootstrap/components/nav_link.rb', line 13
def component_family
:nav
end
|
#data ⇒ Object
25
26
27
|
# File 'lib/nfg_ui/bootstrap/components/nav_link.rb', line 25
def data
tab ? super.merge!(toggle: 'tab') : super
end
|
#dropdown ⇒ Object
17
18
19
|
# File 'lib/nfg_ui/bootstrap/components/nav_link.rb', line 17
def dropdown
options.fetch(:dropdown, false)
end
|
#render ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/nfg_ui/bootstrap/components/nav_link.rb', line 29
def render
if dropdown
NfgUi::Bootstrap::Components::DropdownToggle.new({ body: (block_given? ? yield : body), as: :a, **html_options, theme: nil, nav_link: true }, view_context).render
else
super
end
end
|
#tab ⇒ Object
21
22
23
|
# File 'lib/nfg_ui/bootstrap/components/nav_link.rb', line 21
def tab
options.fetch(:tab, nil)
end
|