Skip to content

Instantly share code, notes, and snippets.

@sbellware
Created March 29, 2011 14:19
Show Gist options
  • Save sbellware/892438 to your computer and use it in GitHub Desktop.
Save sbellware/892438 to your computer and use it in GitHub Desktop.
Example Haml Helper for Creating a Submit Button with Nested Span for its Label
def submit_button(options={})
text = options.delete(:text) || "Submit"
options.merge! :type => :submit
capture_haml do
haml_concat(content_tag(:button, options) do
haml_concat content_tag(:span, text)
end)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment