CoffeeScript y Sinatra

[~/Dropbox/src/ruby/sinatra/sinatra-coffeescript]$ tree
.
|-- app.rb
`-- views
    `-- application.coffee

1 directory, 2 files
[~/Dropbox/src/ruby/sinatra/sinatra-coffeescript]$ cat app.rb 
## You'll need to require coffee-script in your app
require 'sinatra'
require 'coffee-script'

get '/application.js' do
  x = coffee :application
  "<script>#{x}</script>"
end

[~/Dropbox/src/ruby/sinatra/sinatra-coffeescript]$ cat views/application.coffee 
alert "hello world!"

Casiano Rodríguez León
2015-01-25