Answer the question
In order to leave comments, you need to log in
How to set up routing in Rails?
Hello everybody.
There was a need to make url's of the following form: example.com/category_name/post_name
I wrote the
following in the routes.rb file:
resources :categories do
resources :posts
end
Answer the question
In order to leave comments, you need to log in
resources :categories, :path => '' do
resources :posts, :path => ''
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question