Created
August 9, 2012 17:01
-
-
Save kirk/3305918 to your computer and use it in GitHub Desktop.
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
module FormatHelper | |
def boolean_flag(bool, text = nil) | |
"<span class='flag #{bool.to_s}#{ ' labeled' unless text.nil?}'>#{text || bool.to_s}</span>" | |
end | |
def yes_or_no(bool) | |
bool ? 'Yes' : 'No' | |
end | |
end |
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
%table.lite{:cellspacing => '15'} | |
%tbody | |
%tr | |
%th Complete? | |
%td.main= boolean_flag(@idea.complete?, yes_or_no(@idea.complete?)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment