Setup & Installation
Include it in your project's
Gemfile with Bundler:
app/app.rb file to register the plugin:
class ExampleApplication < Padrino::Application # make sure this line is BELOW "register Padrino::Helpers" register Padrino::Assets # put this line if your server ignores config.ru file # like "padrino start" do use Padrino::Assets::App end
config.ru file to mount the environment:
map '/assets' do run Padrino::Assets.environment end
By default, Sprockets is configured to load assets from your project's
lib/assets directories. Any files stored in these directories are readily available to the included helpers and will be served by the Sprockets middleware.
Because of this the following directories are no longer used and will instead be served statically:
You should now be storing your assets in the following directories:
Should your project need to add additional paths you can do so by adding the following line:
Padrino::Assets.load_paths << 'path/to/my/assets'
- Additional documentation
Copyright © 2012 Benjamin Bloch (Cirex). See LICENSE for details.