Created
June 11, 2015 18:59
-
-
Save joshuaogle/58c3a484ad2374e36b4e to your computer and use it in GitHub Desktop.
body_class
This file contains hidden or 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 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