Rails is good for simple APIs (especially adding an API to an existing HTML site).
However, if you want to do more than that, elegantly - it isn't great yet. You quickly end up with some fairly messy serialization hacks and confusion between what should sit in the controller and the model.
The active_model_serializers gem is a really good start, but there is a way to go to get to the level of convention the rest of Rails provides.
Soon it will be great I have no doubt and the convention/stability of Rails will lead a lot of businesses to start using it.
I do agree that the way to provide APIs has been poorly conveyed by the core members. All of the samples end up amounting to:
render :xml => @objects
Which, naturally, falls apart quickly beyond the most basic serialization. However, as long as you treat the API like any other view (even HTML is just another API format), then Rails does a pretty decent job.
Rails is good for simple APIs (especially adding an API to an existing HTML site).
However, if you want to do more than that, elegantly - it isn't great yet. You quickly end up with some fairly messy serialization hacks and confusion between what should sit in the controller and the model.
The active_model_serializers gem is a really good start, but there is a way to go to get to the level of convention the rest of Rails provides.
Soon it will be great I have no doubt and the convention/stability of Rails will lead a lot of businesses to start using it.