Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
How to use Sprockets (aka the asset pipeline) with Sinatra or any Rack based framework
Ruby CoffeeScript
branch: master
Failed to load latest commit information.
assets initial commit
.gitignore initial commit
Gemfile initial commit
Gemfile.lock initial commit
README.markdown initial commit
app.rb initial commit
config.ru initial commit

README.markdown

Sinatra + Sprockets Example

Love the Rails asset pipeline? Wish you could use it everywhere you can use Rack?

This project demonstrates how to use Sprockets (aka the asset pipeline) with Sinatra. Sprockets is rackable, so you can have the joy of asset pipeline wherever you use Rack.

Setup

bundle
rackup
open http://localhost:9292/
open http://localhost:9292/assets/test.js
open http://localhost:9292/assets/test.css

Explanation

app.rb is a Sinatra application that is served from /

config.ru sets up a rackable Sprockets::Environment instance with assets/javascripts and assets/stylesheets added to the load path. This endpoint is mounted at /assets.

Something went wrong with that request. Please try again.