Skip to content
Integrate sprockets with padrino
Ruby
Find file
Pull request Compare This branch is 43 commits ahead, 36 commits behind nightsailer:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/padrino
Gemfile
README.md
padrino-sprockets.gemspec

README.md

Padrino::Sprockets: Integrate Sprockets with Padrino

Installation

Install from RubyGems:

$ gem install padrino-sprockets

Or include it in your project's Gemfile with Bundler:

gem 'padrino-sprockets'

Usage

Your assets place under these path:

app/assets/javascripts
app/assets/images
app/assets/stylesheets

regsiter sprockets in your application:

class Redstore < Padrino::Application
  register Padrino::Sprockets
  sprockets  # :url => 'assets', :root => app.root
end

Now, you can access the asset follow:

#  visit /javascripts/application.js
will find assets under these paths:
 => app/assets/javascripts/application.js
  => app/assets/javascripts/application.js.coffee
   => app/assets/javascripts/application.js.erb

More document about sprockets, please check Sprockets

Helpers Usage

sprockets

 :root =>  'asset root' # default is app.root
 :url => 'assets'  # default map url,location, default is 'assets'
Something went wrong with that request. Please try again.