This is a demo of how to do complex forms with calculations and nested elements. I will shape this example to be a best of example. The proper way of doing AngularJS & Rails together.
Rails should be passing JSON.
This example is based on Rails 3.2.11 CoffeeScript AngularJS angular resource
If you get the error ‘uninitialized constant Debugger::LocalInterface::Readline’ then you have to do the following;
Install libreadline-dev first before running ruby-build
Ubuntu: sudo apt-get install libreadline-dev Fedora: yum install readline-devel
Tutorial http://vxtindia.com/blog/8-tips-for-angular-js-beginners/
AngularJS with Rails nested forms http://tatey.com/2013/01/13/adding-and-removing-children-with-rails-nested-forms-and-angularjs/
Add/Delete nested elements http://jacobmumm.com/2011/08/25/angular-js-nested-repeatable-example/
Common code http://stackoverflow.com/questions/11324202/angularjs-common-controller-functions
AngularJS easy intro http://www.yearofmoo.com/2012/08/use-angularjs-to-power-your-web-application.html
Running integration tests through PhantomJS
rake spec:requests
Running unit tests through jasmine
rails s
Start browser and go to http://localhost:3000/jasmine