method
option_html_attributes
v3.1.0 -
Show latest stable
- Class:
ActionView::Helpers::FormOptionsHelper
option_html_attributes(element)private
No documentation available.
# File actionpack/lib/action_view/helpers/form_options_helper.rb, line 500
def option_html_attributes(element)
return "" unless Array === element
html_attributes = []
element.select { |e| Hash === e }.reduce({}, :merge).each do |k, v|
html_attributes << " #{k}=\"#{ERB::Util.html_escape(v.to_s)}\""
end
html_attributes.join
end