gem install rails -v 4.1
rails new angular_example
Removing turbolinks requires removing it from the Gemfile.
gem 'turbolinks'
Remove the require from app/assets/javascripts/application.js:
//= require turbolinks
In order to get Angular to work with the Rails asset pipeline we need to add to the Gemfile:
gem 'angular-rails-templates'
gem 'bower-rails'
Now run the command
bundle install
Add bower so that we can install the AngularJS dependency:
rails g bower_rails:initialize json
Add Angular to bower.json:
{
"name": "bower-rails generated dependencies",
"dependencies": {
"angular": "latest",
"angular-resource": "latest",
"bourbon": "latest",
"angular-bootstrap": "latest",
"angular-ui-router": "latest"
}
}
Now that bower.json is setup with the right dependencies, let’s install them:
bundle exec rake bower:install
Create the following folder structure in app/assets/javascript/angular-app/: