I think you are mis-interrupting the meaning of that URI. users/1/
projects/1/tasks would mean “Collection of tasks for project with id
== 1 under the user with id == 1.”
In other words “users/1/project” is the collection of projects for a
user with id == 1. Then projects/1/tasks is the collection of tasks
for a project with id == 1. So if projects/1 is not associated to
users/1 then users/1/projects/1/tasks would return an empty collection
because users/1/projects/1 would not be found.
This would mean your database schema would be:
User: has_many :projects
Project: has_many :tasks
Project: belongs_to :user
Task: belongs_to :project
Which is not the structure of the schema you presented.
returns the collection of tasks with the criteria requiring that these
tasks belong to project 1 and these tasks belong to user 1
So if we put it in context, will these url find the following
I want to see Nik’s Cleaning Garage tasks where Nik is the user,
Cleaning Garage is HIS project, the tasks are the get the oil stains
and buy more shelves and etc.
Thank you so much for your time.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.