What’s out there?
Before I’ll promote my own gem, a quick overview of projects with similar scope:
angularjs-rails is an easy way to make Angular available from sprockets. However, I will use a more generic method to achieve this, so we won’t need it.
AngularJS Rails Resource sits on the angular side. It makes communicating with your Rails backend super simple. Awesome!
The bottom two projects are generators for working with Angular. I find generators extremely useful. Their purpose is not to automatically create tons of code, it is more about creating the right files in the right places with minimal boilerplate content to guide you. Especially the ng-rails gem is designed very well!
To conclude, what should an auxiliary gem do for you? In my opinion, it should:
- manage including AngularJS in Rails
- contain generators
- give me tools on the Angular side to work with Rails
It should enforce conventions, but leave the programming to the programmer.
Bower is simple
This is the B of CARB.
Coffee is good
You should use CoffeeScript. It is popular amongst Ruby programmers. For a reason.
This is the C of CARB.
Introducing Regular (Rails + Angular)
Regular is my attempt to implement the CARB stack. It depends on Bower to provide Angular. It comes with generators that promote a convention to organize your Angular project files. It generates Coffee. And it advices you to use AngularJS Rails Resource, because other developers have already thought about how to work with Rails from Angular.