Created
March 29, 2011 14:19
-
-
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
This file contains 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 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