19.
Centralize that Response!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
2 Comments
Would it be best practice to have the serializer method in a service class rather than in the base controller?
Hey Shaun,
It would have more sense if you want to unit-test this serializer service or if you need to reuse it in another spot, like in a service, etc. But for now, this serialize() method contains a single line of code, so there's no code duplication. It probably makes sense to create an abstract controller and move that method to it if you need to use that serialize() method in a few controllers.
Cheers!
"Houston: no signs of life"
Start the conversation!