Using Bower In Rails

Nov 2, 2014Ryan Burnette

I like for using Bower with Rails to be as simple as running bower install -S package and including it from my asset file. It takes a couple configuration steps to get to that point.

Set a non-standard directory for bower_components by creating a .bowerrc file and adding a directory option.

Add the new directory to the auto-load path by updating initializers/assets.rb.

For an added convinience I like to rails generate task bower and add a couple tasks. This provides shortcuts and tasks that are useful in deployments.

You can bowerify your project right now with this shell script.

curl | bash

Blog Index