Class: Navgate::Builder
Instance Attribute Summary
Attributes inherited from Base
#by_id, #controller, #css_class, #default, #namespace, #prefix, #selection
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Base
Instance Method Details
#render_it_with(options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/navgate.rb', line 5 def render_it_with() = "" if .each do |key,value| += ("#{key}=#{value}" + " ") unless ignoring key += ("class='#{self.css_class}") if self.css_class end end style = styling() @text_to_render = "" if !self.by_id self.selection.each do |select| wrap_with [:wrap] do @text_to_render += "<a href=\"#{path_for(select)}\" #{}>#{select.gsub('_'," ")}</a>#{style}" end end else self.selection.each_with_index do |select,i| wrap_with [:wrap] do @text_to_render += "<a href=\"#{path_for(self.by_id[i])}\" #{}>#{select.gsub('_'," ")}</a>#{style}" end end end @text_to_render end |