我一直在处理一组类似的问题。有一些很好的工具可以让你将 AngularJS 直接集成到你的 rails 资产管道中,如果你只想要一点 Angular,它们对我来说看起来不错。
但是,如果您想要一个完整的 Angular 前端,也就是单页 Web 应用程序,我认为您最终会受到兼容性和一些工具的限制。我觉得 Rails gem 跟不上 Angular,所以你会遇到版本冲突。我还看到越来越多的 Angular 独立工具,我非常喜欢ng-boilerplate项目模板。我也喜欢很多测试工具,例如 karma,但我还没有真正找到将 karma 与 rails 集成的方法。
For that reason, I eventually decided that I'd keep the two separate. Initially, I did that through creating a rails application and a separate angular application (separate directories). I used ng-boilerplate as the framework for the angular end. I wrote a tutorial on that. This eventually got a bit frustrating, and I wrote some more thoughts on it, the main annoyance was that I had two git repositories and it was annoying to keep them in synch. It's also sort of annoying working with an IDE across two directories. I've ended up shifting to rails and angular being in the same folder, and they seem to play nice, as each uses different directories within that project.
In this current structure, I'm using the grunt setup that came with ng-boilerplate to minify all the code, package it and also run karma unit testing. I haven't yet nailed the end-to-end testing, but it's on my list. I've found this to be a relatively productive work environment. My chosen structure for my pages, controllers and karma test cases has some repeated code (I'm choosing not to factor it out to maintain readability). I'm planning to extend the rails scaffold generator to create the javascript framework for me - so when I create a persons rails scaffold, it will also create a persons angularjs scaffold for me. I'll update here if and when I do that work.
EDIT: I've completed the scaffolding work as well, which allows rails to automatically generate the angularJS elements when you generate the rails models/controllers etc. The blog post is here: http://technpol.wordpress.com/2013/09/24/rails-generator-to-generate-angular-views/