Your users
can have many transactions
right? So it is better to have a separate controller for transactions. Just like you did for your users do it for transactions. Separation of Concerns
GET /transactions
GET /transactions/1
This way you'll not only benefit the simplicity of GET
in your controller but also you can structure your controller to accept POST
, DELETE
, and PUT
.