I am newish to Ruby on Rails, using version 4.1 in a project.
I am a bit confused about the way the nested resources are working in rails. Perhaps someone can help.
I am building a tasking system as a learning project.
I have websites that have tasks that belong to them. When viewing tasks, I can do:
resources :websites do
resources :tasks
end
And a link will take me to my task just fine, with a url like http://myapp.com/websites/2/tasks/3
<%= link_to 'Show', website_task_path(website,task) %>
What I noticed though, is that I can change the website id in the url to anything - http://myapp.com/websites/what-the-hell-is-going-on-here/tasks/1 - works just the same as the other link. Or I can access that task with a different website id in the url as well.
So the question is, is Rails supposed to do anything with that piece of information by default? Is it up to me if I want to make sure that you are accessing the task with the right parent resource in the parameters?