In Ruby, I like to think of one class responsible for the content of the response document sent back to the requester:
class Api::Posts def to_json end end
And at the GET /api/posts endpoint, your response document is the results of calling Api::Posts#to_json. This is a simplification.
GET /api/posts
Api::Posts#to_json
Its all coming together now this is so sick! can't wait to try this out. thank you.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In Ruby, I like to think of one class responsible for the content of the response document sent back to the requester:
And at the
GET /api/postsendpoint, your response document is the results of callingApi::Posts#to_json. This is a simplification.Its all coming together now this is so sick! can't wait to try this out. thank you.