Skip to content

Instantly share code, notes, and snippets.

@funkfinger
Created April 1, 2010 12:23
Show Gist options
  • Save funkfinger/351738 to your computer and use it in GitHub Desktop.
Save funkfinger/351738 to your computer and use it in GitHub Desktop.
before do
# remove and grab the file extension
request.path_info.sub! %r{\.([^\./]+)$}, ''
@format=$1 || 'html'
@charset=mime_type($1) || 'text/html'
content_type @charset, :charset => 'utf-8'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment