class Topic < ActiveRecord::Base
has_many :posts
end
class Post < ActiveRecord::Base
belongs_to :topic
has_many :comments
end
class Comment < ActiveRecord::Base
has_ancestry
belongs_to :post
end
MyApp::Application.routes.draw do
resources :posts do
resources :comments
end
resources :topics
root :to => "posts#index"
end
class Topic < ActiveRecord::Base
has_many :