This library adds angularjs support to Rails applications
This project lets you use angularjs with the yummy Rails 3.1 asset pipeline. The eventual goal is to have it integrate scaffolding with test support.
This library hasn't been updated for a while. Rails 3 is now Rails 5. Angularjs 1 is now Angular 7. Use at your peril :).
The initial fork/inspiration was from the backbone-rails project.
Add to your gemfile:
And bundle away. To bootstrap things then type:
rails g angular:install
rails g angular:installwill create the following directory structure under
controllers/ filters/ services/ widgets/
It will also generate a
templates/directory under app assets, where view templates can be stored. This lets you use haml, etc. for your angular views.
It will also add to the application.js file the appropriate requires.
So far we have a controller generator which generates a controller file if you rum
rails g angular:controller MODELNAME
This file is empty except for the class declaration, but I will be adding some RESTful controller functionality shortly.
Created a new rails 3.1 application called
rails new blog
Edit your Gemfile and add
Install the gem and generate scaffolding.
bundle install rails g angular:install
You now have installed the angular-rails gem, setup a default directory structure for your frontend angular code.