Integration of angular 2 tour of heroes with rails 5 api
Hi fellas I know its been a hard journey of angular 2 tour of heroes but now once you are done with tour of heroes you may want it to integrate with Rails 5 api only application and to achieve that first you need a separate rails 5 api only application I have wrote a blog for rails 5 with hero resource just follow that and create a basic rails 5 api app with hero resource. http://nitanshu.blogspot.in/2016/08/initialization-of-rails-5-api-only.html In the json you see created_at and updated_at keys it will cause problems on the Angular 2 end since our app is only expecting the id and name attributes. Let’s take care of that right now since we’re already working on the Rails side. We’ll need to add the active_model_serializers gem to our Gemfile . gem 'active_model_serializers' bundle install mkdir app/serializers Create a new file called app/serializers/hero_serializer.rb with the following content. class HeroSerializer < ActiveModel::Serializer att