Skip to content

Instantly share code, notes, and snippets.

@kirk
Created August 9, 2012 17:01
Show Gist options
  • Save kirk/3305918 to your computer and use it in GitHub Desktop.
Save kirk/3305918 to your computer and use it in GitHub Desktop.
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
%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