Created
August 13, 2009 05:03
-
-
Save sbellware/167002 to your computer and use it in GitHub Desktop.
Options to HTML Attributes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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