Render a list of tabs with html common options (:id and :class) ( the
navigator must be configured previously with ‘create_tab_navigator’ method )
37: def render_tab_navigator(navigator, options = {})
38:
39: navigator.html_options[:id] ||= options[:id]
40: navigator.html_options[:class] ||= options[:class]
41:
42: @html = tag('ul', navigator.html_options , true)
43: navigator.sort! if options[:sort] == true
44:
45: navigator.tabs.each do |tab|
46: li_options = {}
47:
48: li_options[:id] = "#{tab.id}" if tab.id
49: li_options[:title] = "#{tab.title}" if tab.title
50: li_options[:class] = "#{tab.class}" if tab.class
51:
52: if tab.is_highlighted?(params) && tab.highlight_option_active
53: li_options[:class] = "#{tab.highlighted_class}" if tab.highlighted_class
54: end
55:
56: attach tag('li', li_options, true)
57: if tab.has_link?
58: attach link_to(tab.text, tab.link, tab.html)
59: else
60: attach content_tag('span', tab.text, tab.html)
61: end
62: attach "</li>\n"
63: end
64: attach '</ul>'
65:
66: @html
67: end