lib/jqr-helpers/helpers.rb in jqr-helpers-1.0.69 vs lib/jqr-helpers/helpers.rb in jqr-helpers-1.0.70
- old
+ new
@@ -319,10 +319,10 @@
def buttonset(name, values, selected=nil, html_options={})
html_options[:class] ||= ''
html_options[:class] << ' ujs-button-set'
given_id = html_options.delete(:input_id)
content = values.inject('') do |sum, (value, label)|
- id = "#{name}_#{value}"
+ id = "#{sanitize_to_id(name)}_#{sanitize_to_id(value)}"
id << "_#{given_id}" if given_id
sum += radio_button_tag(name, value, selected == value, :id => id) +
label_tag(id, label)
end
content_tag(:div, raw(content), html_options)