Skip to content
Asset minification and bundling for Sinatra
JavaScript Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/sinatra
.gitignore
Gemfile
README.md
Rakefile
sinatra-simple-assets.gemspec

README.md

Sinatra Simple Assets

# Gemfile
gem 'sinatra-simple-assets', :require => 'sinatra/simple_assets'

# Sinatra app
register Sinatra::SimpleAssets

assets do
  css :application, [
    '/stylesheets/bootstrap.css',
    '/stylesheets/application.css'
  ]
  js :application, [
    '/javascripts/bootstrap-modal.js',
    '/javascripts/bootstrap-dropdown.js',
    '/javascripts/bootstrap-scrollspy.js',
    '/javascripts/bootstrap-buttons.js',
    '/javascripts/bootstrap-tabs.js',
    '/javascripts/bootstrap-twipsy.js',
    '/javascripts/bootstrap-popover.js',
    '/javascripts/bootstrap-alerts.js',
    '/javascripts/application.js'
  ]
end

# Views
<%= javascript :application %>
<%= stylesheet :application %>

# Rakefile
namespace :assets do
  desc 'Precompile assets'
  task :precompile do
    App.assets.precompile
  end
end
Something went wrong with that request. Please try again.