Skip to content

Instantly share code, notes, and snippets.

@tboerger
Created May 13, 2014 12:11
Show Gist options
  • Save tboerger/dfb7add6b0753e60fedd to your computer and use it in GitHub Desktop.
Save tboerger/dfb7add6b0753e60fedd to your computer and use it in GitHub Desktop.
module Haml
module Compiler
class << self
def build_attributes_with_dasherize(is_html, attr_wrapper, escape_attrs, attributes = {})
new_attributes = {}.tap do |dasherized|
attributes.keys.each do |key|
dasherized[key.to_s.gsub("_", "-").to_sym] = attributes[key]
end
end
build_attributes_without_dasherize(
is_html,
attr_wrapper,
escape_attrs,
new_attributes
)
end
alias_method :build_attributes_without_dasherize, :build_attributes
alias_method :build_attributes, :build_attributes_with_dasherize
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment