Created
June 24, 2012 00:24
-
-
Save smonteverdi/2980703 to your computer and use it in GitHub Desktop.
Rails: Helper: Status Tag
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 status_tag(boolean, options={}) | |
options[:true] ||= '' | |
options[:true_class] ||= 'status true' | |
options[:false] ||= '' | |
options[:false_class] ||= 'status false' | |
if boolean | |
content_tag(:span, options[:true], :class => options[:true_class]) | |
else | |
content_tag(:span, options[:false], :class => options[:false_class]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment