lib/builders/html_builder.rb in navigasmic-0.5.5 vs lib/builders/html_builder.rb in navigasmic-0.5.6
- old
+ new
@@ -25,12 +25,12 @@
def group(label = nil, options = {}, &proc)
raise ArgumentError, "Missing block" unless block_given?
options[:html] ||= {}
- options[:html][:class] = template.add_class(options[:html][:class], @@classnames[:with_group])
- options[:html][:id] ||= label.to_s.gsub(/\s/, '_').underscore unless label.blank?
+ options[:html][:class] = template.add_html_class(options[:html][:class], @@classnames[:with_group])
+ options[:html][:id] ||= label.to_s.gsub(/\s/, '_').underscore unless label.blank? || options[:html].has_key?(:id)
buffer = template.capture(self, &proc)
group = template.content_tag(@@group_tag, buffer)
label = label_for_group(label) unless label.blank?
@@ -42,14 +42,14 @@
buffer = block_given? ? template.capture(self, &proc) : ''
item = NavigationItem.new(label, options, template)
options[:html] ||= {}
- options[:html][:id] ||= label.to_s.gsub(/\s/, '_').underscore
+ options[:html][:id] = label.to_s.gsub(/\s/, '_').underscore unless options[:html].has_key?(:id)
- options[:html][:class] = template.add_class(options[:html][:class], @@classnames[:disabled]) if item.disabled?
- options[:html][:class] = template.add_class(options[:html][:class], @@classnames[:highlighted]) if item.highlighted?(template.request.path, template.params, template)
+ options[:html][:class] = template.add_html_class(options[:html][:class], @@classnames[:disabled]) if item.disabled?
+ options[:html][:class] = template.add_html_class(options[:html][:class], @@classnames[:highlighted]) if item.highlighted?(template.request.path, template.params, template)
label = label_for_item(label)
link = item.link.is_a?(Proc) ? template.instance_eval(&item.link) : item.link
label = template.link_to(label, link, options.delete(:link_html)) unless !item.link? || item.disabled?
@@ -64,6 +64,6 @@
def label_for_item(label)
template.content_tag(@@label_tag, label.to_s)
end
end
-end
\ No newline at end of file
+end