Crossings along the way in rails 3

So, I want my application to create routes like stack overflow

questions/:id/:title 

How can I do this on rails?

+2
source share
3 answers

This is what I was looking for:

http://norman.github.com/friendly_id/file.Guide.html

Hope this can help others!

+3
source

Note:

 http://stackoverflow.com/questions/4434266/stack-overflow-like-url-routes-in-rails-3 http://stackoverflow.com/questions/4434266/ http://stackoverflow.com/questions/4434266/you-can-put-wathever-you-want-here 

Same. I think stackoverflow just does this to provide some context if you only see the link.

So your route will be just like this:

 http://stackoverflow.com/questions/4434266/ 

which should look something like this:

 http://stackoverflow.com/questions/:id 

You can ignore the rest of the URL

+3
source

Everything you could find out about routes: http://guides.rubyonrails.org/routing.html

0
source

Source: https://habr.com/ru/post/1336980/


All Articles