Skip to content

Instantly share code, notes, and snippets.

@jakelodwick
Created August 17, 2014 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakelodwick/4b6e1f938403a1c92cf5 to your computer and use it in GitHub Desktop.
Save jakelodwick/4b6e1f938403a1c92cf5 to your computer and use it in GitHub Desktop.
CoffeeScript in Sinatra apps
#put this in your Gemfile:
gem "rack-coffee"
#(don't forget to run `bundle` on the command line)
#put this in your Sinatra app:
use Rack::Coffee,
:root => 'public',
:urls => '/coffee',
:join => 'index',
:bare => true
#store .coffee files like this:
#./public/coffee/Foo.coffee
#request them like this:
#http://server/coffee/Foo.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment