Skip to content

Instantly share code, notes, and snippets.

@sbellware
Created August 13, 2009 05:03
Show Gist options
  • Save sbellware/167002 to your computer and use it in GitHub Desktop.
Save sbellware/167002 to your computer and use it in GitHub Desktop.
Options to HTML Attributes
def options_to_html_attributes(options)
html_attributes = ""
options.each do |k, v|
html_attributes << "#{k.to_s}=\"#{v}\" "
end
html_attributes.rstrip
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment