form_angular

Rails gem for forms using Angular

Add these gems to your Gemfile

gem 'simple_form' gem 'form_angular'

If you are not already including AngularJS then : gem 'angular-rails'

Currently uses simple forms, might grow out of it and stay compatible for performance purposes.

Enabling an angular form

simple_form_for Object|Symbol|Class ngform:true

This enables ng-model on every field in the form. The value of the attribute is extracted from the context, where every simple_fields_for instruction adds a nested level within the context, using snake case constant names

Therefore, for an object class A attr SomeString b, AThirdAttr becomes a.some_string.a_third_attr

The form name is set by the object class name or symbol as a camel-case string.

TBD

- implement black box tests
- use autoload
- grow out of simple form
- factor code that climbs up the form/fieldset tree to build strings
- add option to override default rails attribute naming with the ng_model's value