0
的routes.rb轨道转换路径例如
match "about/how_it_works" => "about#how_it_works", :as => "about_how_it_works", :via => :get
match "about/we_are" => "about#we_are", :as => "about_we_are", :via => :get
match "about/what_is" => "about#what_is", :as => "about_what_is", :via => :get
我读this rails guide,改变了我的代码。
新的routes.rb
scope(path_names: { about_we_are: 'translated-about-we-are', about_what_is: 'translated-about-what-is' }) do
resources :about, path: 'translated-about'
end
但是,当我输入localhost:3000 /约/翻译 - 约-WE-是,我没有遇到路由匹配error.Do你知道如何与这个处理问题?