Class: Interview::Breadcrumbs

Inherits:
Control
  • Object
show all
Includes:
HasControls
Defined in:
lib/interview/breadcrumbs.rb

Instance Attribute Summary

Attributes included from HasControls

#controls

Attributes inherited from Control

#parent

Instance Method Summary collapse

Methods included from HasControls

#add_control, #add_controls, included, #initialize, #siblings

Methods inherited from Control

#ancestors, build, definition, #find_attribute, #find_attribute!, inherited, #initialize, #set_attributes, #set_defaults

Instance Method Details

#renderObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/interview/breadcrumbs.rb', line 6

def render
  if Object.const_defined?('Gretel')
    return h.breadcrumbs
  else
    html = Builder::XmlMarkup.new
    html.ol class: 'breadcrumb' do
      @controls.each do |control|
        html << control.render
      end
    end
    return html.target!
  end
end