Why do you choose ams (active model serializer) over jbuilder or the other way around? (Rails API)
Hey Guys,
I'm interested in knowing, why some developers choose ams over jbuilder and some prefer jbuilder over ams, to build Rails based API's.
Cheers,
Drilon
Mostly the reason why AMS is used over jBuilder is that it's agnostic from the format. You can choose to output AMS in different formats using different adapters like the JSON API adapter. This means you can define the attributes and relationships of your data that you want to export, but you don't have to match that exactly with the JSON format. It becomes more interchangeable that way and you can make modifications a bit easier.
jBuilder is a lot more manual building out the exact structure of the JSON which makes it a bit harder to work with generally.
jBuilder is a lot more manual building out the exact structure of the JSON which makes it a bit harder to work with generally.
Is it possible that jBuilder would be considered a starting point in a Payloads lifecycle? Based on what I just watched you demo jbuilder it seems that it's pretty simple to begin with. Is it normal to see both implementations in a code base? jbuilder for the simpler more static content and grow to AMS when needed?