Module: Xebec::NavBarHelper
- Includes:
- HTML5, HasNavBars
- Defined in:
- lib/xebec/nav_bar_helper.rb
Constant Summary
Constants included from HTML5
Instance Method Summary collapse
-
#add_html5_dom_elements_to_ie ⇒ Object
Renders a
<script>
tag that preloads HTML5 tags in IE. -
#nav_bar(name = nil, html_attributes = {}, options = {}, &block) ⇒ Xebec::NavBarRenderer
If called in an output expression (“<%= navbar %>” in ERB or “=navbar” in HAML), renders the navigation bar.
-
#nav_bar_unless_empty(name = nil, html_attributes = {}) ⇒ String, Xebec::NavBarRenderer
Renders a navigation bar if and only if it contains any navigation items.
Methods included from HTML5
Instance Method Details
#add_html5_dom_elements_to_ie ⇒ Object
Renders a <script>
tag that preloads HTML5 tags in IE. Useful if you called Xebec.html5_for_all_browsers!
in your environment.rb
.
54 55 56 57 58 59 60 |
# File 'lib/xebec/nav_bar_helper.rb', line 54 def add_html5_dom_elements_to_ie return <<-EOS <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> EOS end |
#nav_bar(name = nil, html_attributes = {}, options = {}, &block) ⇒ Xebec::NavBarRenderer
If called in an output expression (“<%= navbar %>” in ERB or “=navbar” in HAML), renders the navigation bar.
If called with a block, yields the underlying NavBar for modification.
34 35 36 |
# File 'lib/xebec/nav_bar_helper.rb', line 34 def (name = nil, html_attributes = {}, = {}, &block) name, html_attributes, , &block end |
#nav_bar_unless_empty(name = nil, html_attributes = {}) ⇒ String, Xebec::NavBarRenderer
Renders a navigation bar if and only if it contains any navigation items. Unlike nav_bar
, this method does not accept a block.
43 44 45 46 |
# File 'lib/xebec/nav_bar_helper.rb', line 43 def (name = nil, html_attributes = {}) = name, html_attributes .empty? ? '' : end |