Nested routing in Ruby on Rails
- by vooD
My model class is:
class Category < ActiveRecord::Base
acts_as_nested_set
has_many :children, :foreign_key => "parent_id", :class_name => 'Category'
belongs_to :parent, :foreign_key => "parent_id", :class_name => 'Category'
end
def to_param
slug
end
Is it possible to have such recursive route like this:
/root_category_slug/child_category_slug/child_of_a_child_category_slug ... and so one
Thank you for any help :)