Skip to content

Instantly share code, notes, and snippets.

@smonteverdi
Created June 24, 2012 00:24
Show Gist options
  • Save smonteverdi/2980703 to your computer and use it in GitHub Desktop.
Save smonteverdi/2980703 to your computer and use it in GitHub Desktop.
Rails: Helper: Status Tag
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