Skip to content

Instantly share code, notes, and snippets.

@retr0h
Created April 20, 2009 01:14
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save retr0h/98308 to your computer and use it in GitHub Desktop.
CONTENT_TYPES = {:html => 'text/html', :css => 'text/css', :js => 'application/javascript'}
before do
request_uri = case request.env['REQUEST_URI']
when /\.css$/ : :css
when /\.js$/ : :js
else :html
end
content_type CONTENT_TYPES[request_uri], :charset => 'utf-8'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment