lib/builders/html_builder.rb in navigasmic-0.1.3 vs lib/builders/html_builder.rb in navigasmic-0.1.5

- old
+ new

@@ -12,11 +12,11 @@ @@label_tag = :span attr_accessor :template, :name, :items def initialize(template, name, options = {}, &proc) - @template, @name, @items = template, name.to_s, options, [] + @template, @name, @items = template, name.to_s, [] render(options.delete(:html), &proc) end def render(options, &proc) buffer = template.capture(self, &proc) @@ -38,10 +38,10 @@ end def item(label, options = {}, &proc) buffer = block_given? ? template.capture(self, &proc) : '' - item = NavigationItem.new(label, options) + item = NavigationItem.new(label, options, template) options[:html] ||= {} options[:html][:id] ||= label.to_s.gsub(/\s/, '_').underscore options[:html][:class] = template.add_class(options[:html][:class], @@classnames[:disabled]) if item.disabled? \ No newline at end of file