Skip to content

Instantly share code, notes, and snippets.

@joshuaogle
Created June 11, 2015 18:59
Show Gist options
  • Select an option

  • Save joshuaogle/58c3a484ad2374e36b4e to your computer and use it in GitHub Desktop.

Select an option

Save joshuaogle/58c3a484ad2374e36b4e to your computer and use it in GitHub Desktop.
body_class
module ApplicationHelper
def body_class
"#{controller_name} #{controller_name}-#{controller.action_name} #{page_id}"
end
def controller_name
controller.controller_path.gsub('/','-')
end
def page_id
params['id']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment