'render' is not your final word in your Rails controller's action
https://blog.arkency.com/render-is-not-your-final-word-in-your-rails-controllers-action/
Suppose you are using some library that performs some logic in your controller and render some templates once some invariants are not met. Assume the library is old and was created once you were not using JSON API but was only rendering HTML templates. Now you need to add similar logic to your API controller. You may think that you should now modify the library to handle JSON responses, but that’s not the only solution you can use.
Post a comment