路线.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
我阅读了这个 Rails 指南并更改了我的代码。
新路线.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/about/translated-about-we-are 时,我遇到 no route matches 错误。你知道如何处理这个问题吗?