Skip to content

Instantly share code, notes, and snippets.

@rsl
Created July 16, 2014 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsl/6212bc1575c009242def to your computer and use it in GitHub Desktop.
Save rsl/6212bc1575c009242def to your computer and use it in GitHub Desktop.
def body_class(string = nil)
[string].tap do |names|
# Standard
names << controller_name << action_name
# App-specific
names << 'foo' if foo? # Et cetera
end.compact.join ' '
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment