Skip to content

Instantly share code, notes, and snippets.

@slant
Forked from retr0h/gist:98308
Created February 9, 2010 20:54
Show Gist options
  • Save slant/299650 to your computer and use it in GitHub Desktop.
Save slant/299650 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