Topic: Nested route


If I use a nested route do I then not have to use a find "where" in the controller index action? (relationships are already set up in the models).


Re: Nested route

I'm not sure how you think it should liberate you from using where in the index action, but anyway - no. Routing has nothing to do with what action itself does. smile

Re: Nested route
2.7 Nested Resources

class Magazine < ActiveRecord::Base
  has_many :ads

class Ad < ActiveRecord::Base
  belongs_to :magazine

Nested routes allow you to capture this relationship in your routing. In this case, you could include this route declaration:
resources :magazines do
  resources :ads
I'm just trying to figure out routing...

Last edited by dcastellano1 (2011-01-24 20:17:05)

Re: Nested route

Nested routing is about routes, not about the behavior of your actions.