4 ms·
The Rails-API project is here to help! http://github.com/rails-api/rails-api http://github.com/rails-api/rails-api I don't personally know of anyone using Angu
by steveklabnik 13y ago
The Rails-API project is here to help! http://github.com/rails-api/rails-api http://github.com/rails-api/rails-api
I don't personally know of anyone using Angular + Turbolinks, so I can't answer that.
- playing_colours 13y agoThanks, I'm building Angular.js app and adopting Rails 4 for api backend, Will Rails-API be updated for Rails 4 ?
- steveklabnik 13y agoIt should work today. If it does not, it's a bug. By the way, ActiveModel::Serializers is part of the Rails API project[1], and we'd love some thoughts on how to make it work well with Angular. 1: https://github.com/rails-api/active_model_serializers https://github.com/rails-api/active_model_serializers
- janus 13y agoThe only issue that's been biting me when using ActiveModel::Serializers and AngularJS is that we must manually return the json with the root: false option set, otherwise the AngularJS $resource provider doesn't work correctly.
- lentil 13y agoIf it helps you can make that the default for all your serializers, by doing something like this in an initializer: ActiveSupport.on_load(:active_model_serializers) do ActiveModel::ArraySerializer.root = false ActiveModel::Serializer.root = false end
- danmaz74 13y agoLooks like it already is: https://news.ycombinator.com/item?id=5940484 https://news.ycombinator.com/item?id=5940484
- bti 13y agoWow that looks great. Are there any benchmarks as to how much faster it is compared to a vanilla Rails app?
- steveklabnik 13y agoIt's difficult to benchmark, to be honest: Rails apps depend on so many things, there are too many variables. I'd love to hear from some people who have tried it in their apps though! I'm more interested in it as a place to explore best practices and work on useful things around names, than the speed aspects.