i am using ruby on rails i have models -category -subcategory -city -firm
when i click on category it will show sub categories and permalink should be: example.com/category when i click subcategory it will show firms and city names. example.com/category/subcategory when i click on city name it will filter firms belongs to that city example.com/category/subcategory/city when i click on firm name it will show example.com/category/subcategory/city/firm-name
firms may have more than one sub category
i used premalink_fu but i could not do that sub category system. category,subcategory,city,firm tables have their own permalink field on db. but i don't know how to combine them dynamically.
i can do example.com/category but i cant do example.com/category/subcategory
how can i do that please help me