Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryanburnette/9001582 to your computer and use it in GitHub Desktop.
Save ryanburnette/9001582 to your computer and use it in GitHub Desktop.
module ApplicationHelper
# get the name of the current layout in views
# http://stackoverflow.com/a/9438314/2535178
def current_layout
layout = controller.send(:_layout)
if layout.instance_of? String
layout
else
File.basename(layout.identifier).split('.').first
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment