Answer the question
In order to leave comments, you need to log in
How to convert Django route to RoR route?
There are such routes on the rail.
match "/:dist/:category/" => "index#viewcategory",via:[:get], :constraints => { :dist => /[a-zA-Z\-[0-9]]*/ }
match "/:dist/:category/:item/" => "index#viewitem",via:[:get], :constraints => { :dist => /[a-zA-Z\-[0-9]]*/ }
url(r'^(?P<slug1>(.*))/(?P<slug2>(.*))/$', 'app.views.view1'),
url(r'^(?P<slug1>(.*))/(?P<slug2>(.*))/page(?P<page>(\d+))/$', 'app.views.view1'),
url(r'^(?P<slug1>(.*))/(?P<slug2>(.*))/(?P<slug3>(.*))/$', 'app.views.view2'),
url(r'^(?P<slug1>(.*))/(?P<slug2>(.*))/page(?P<page>(\d+))/$', 'app.views.view1')
for the rail. I don't even know which way to look. What can be done about it?
Answer the question
In order to leave comments, you need to log in
match "/:dist/:category/page(:page)/" => "index#viewcategory",via:[:get],:constraints => { :dist => /[a-zA-Z\-[0-9]]*/ }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question