Answer the question
In order to leave comments, you need to log in
Routing change?
Hello friends.
I'm trying to make the post links look like this
/news/eda/kak_est_edy.html
I have a very hard time with English
Categories with posts are linked by post_id
In routes.rb I'm trying to create a path
get 'news/:cat_seo_url/:id', to: 'posts #show', as: 'news_show'
Where cat_seo_url is the url that is specified when creating the category.
In post_controller in show I enter
def show
@post=Post.find_cat_seo_url!(params[:id])
end
On the end I get No route matches missing required keys: [:id]
Tell me what I'm doing wrong?
How to give him an ID?
Answer the question
In order to leave comments, you need to log in
just leaving it here https://github.com/norman/friendly_id
also what you are trying to do is stackoverflow.com/questions/12353088/route-for-sho...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question