Skip to content

Instantly share code, notes, and snippets.

@joemsak
Created September 20, 2012 20:16
Show Gist options
  • Save joemsak/3758094 to your computer and use it in GitHub Desktop.
Save joemsak/3758094 to your computer and use it in GitHub Desktop.
def active_if_selected(path)
'active' if /^\/#{path}/ =~ request.path
end
def active_if_child(path)
'active' if /#{path}$/ =~ request.path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment