Class: NavigatorRails::Decorators::Navigator
- Inherits:
-
Object
- Object
- NavigatorRails::Decorators::Navigator
show all
- Includes:
- Generic
- Defined in:
- lib/navigator_rails/decorators/navigator.rb
Instance Attribute Summary
Attributes included from Generic
#type
Instance Method Summary
collapse
Methods included from Generic
#child_count, #children, #children_except, #children_of, #draw, #draw_children, #has_visible_children, included, #resource
Instance Method Details
#brand ⇒ Object
5
6
7
8
|
# File 'lib/navigator_rails/decorators/navigator.rb', line 5
def brand
brand = resource.children(type: :brand).first
brand.decorator.draw(brand).html_safe
end
|
#template ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/navigator_rails/decorators/navigator.rb', line 9
def template
" <div class=\"navbar navbar-default navbar-fixed-top\">\n <div class=\"container\">\n <div class=\"navbar-header\">\n <button type=\"button\" data-toggle=\"collapse\" data-target=\".navbar-collapse\" class=\"navbar-toggle\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <%= brand %>\n </div>\n <div class=\"collapse navbar-collapse\">\n <%= draw_children(children_except(type: :brand)) %>\n </div>\n </div>\n </div>\n LINK_DECORATION\nend\n".strip_heredoc
|