Skip to content

Instantly share code, notes, and snippets.

@olvado
Created November 1, 2012 10:46
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 olvado/3993008 to your computer and use it in GitHub Desktop.
Save olvado/3993008 to your computer and use it in GitHub Desktop.
Helper to test what controller and/or action the current view is
def is_controller(string)
str = string.split("#")
str.length == 1 ? string == controller_name : string == "#{controller_name}##{action_name}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment