I have a application that I am building with edge rails. I am using the map.resources in my routes.config and this is what I have
map.resources :categories do |categories|
categories.resources :businesses do |businesses|
businesses.resources :ratings end categories.resources :criterias
This is the first application that I attempted this with, so if anything is wrong please point it out to me. My question is that when using ratings_url I have to supply @category, @business to get the url to be created. While this is fine, when I want to use business_url I have to use @category in the views like so,
<%= link_to ‘Show’, business_path(@category, @business) %>
but in my business controller it is like this,
and I do not have to supply the @category. Is it because one uses a path while the other uses a url? I have tests that run on all of this and they all pass, so I know that the code is correct. Why does it work this way? Why do I not have to supply the @category for business_url but I do for rating_url?