O'Reilly logo

Rails, Angular, Postgres, and Bootstrap by David B. Copeland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring Rails and Angular

To start using Angular with Rails, we mostly just need to install Angular using Bower, and arrange for Angular’s code to be served up by the asset pipeline. First, we’ll add Angular to Bowerfile.

 asset 'bootstrap-sass-official'
 # START_HIGHLIGHT
 # END_HIGHLIGHT
 asset 'angular', '~> 1.5'
 resolution 'angular', '1.5'

Note the use of the resolution keyword. Bower isn’t as sophisticated as Bundler at handling dependencies, and when it isn’t 100% sure what version of something to grab, it asks you, interactively. This is somewhat inconvenient, so you can specify a specific version to use for a specific asset. In this case, it does look confusing, because we really only have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required