Skip to content

Instantly share code, notes, and snippets.

@samg
Created November 3, 2011 21:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samg/1337842 to your computer and use it in GitHub Desktop.
Save samg/1337842 to your computer and use it in GitHub Desktop.
class ApplicationController
private
def newrelic_metric_path(action_name_override = nil)
format_string = case
when request.format.html?
'.html'
when request.format.json?
'.json'
when request.format.xml?
'.xml'
end
"#{super}#{format string}"
end
end
# This should cause your controller actions to be reported under names like
# BlogController#index.json, BlogController#index.html, etc.
@bradhe
Copy link

bradhe commented Nov 4, 2011

sweet gist bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment