One day I was searching to integrate
sprockets to my padrino application, I found following article to make it.
Sprockets & Bower in my Padrino please.
In the article he explained to integrate sprockets to padrino using sprockets-helpers, through rack.
I was so excited because the content is what I wanted to do. But few hours after, I realized the way he explained works good for
production environment, but not for
test environment since in
I began to search how to mount(or insert) sprockets middleware in padrino applicaiton again and found the following way to solve the issue.
The difference found way and previous article way is just how to insert sprockets middleware.
Rakefile are same.
app/app.rb differs little bit, and
lib/sprockets_initializer.rb will be newly created.
lib/sprockets_initializer.rb is used to register to use Sprockets::Server for assets request handler.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
app/app.rb register it only for not production environment because in production environment, I want to let application read assets from compiled assets path.
1 2 3 4 5 6 7 8 9 10
If you want, delete mounted sprockets from
1 2 3
After changed configuration like above, you can test your application previous style.
Thank you for reading!