I have a category with a subcategory and the subcategory has posts. I'd like to link it as following:
/categoryname/subcategoryname/post_id/postname
I've tried doing so by putting this in my routes:
resources :categories do
resources :subcategories do
resources :posts
end
end
But any time I'd like to create a link for my subcategories (/categoryname/subcategory/
) via link_to(subcat.name, category_subcategory_path)
I get:
No route matches {:controller=>"subcategories", :action=>"show"} missing required keys: [:category_id, :id]
How would I approach this to get the desired link setup?
Thanks in advance,