「レールキャスト」のキャストを見て、彼らが私に言ったようにしました。これが私のroute.rbの一部です
scope ':locale', :locale=> /#{I18n.available_locales.join("|")}/ do
#..........
#..........
namespace :admin do
resources :products do
get :who_bought, :on=>:member
end
end
end
match '*path', :to=> redirect("/#{I18n.default_locale}/%{path}")
match '', :to=> redirect("/#{I18n.default_locale}")
このため、現在いくつかの問題が発生しています。私のログを見てください。
Started GET "/products/4/who_bought.atom" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
2012-08-31 09:58:35 INFO --
Started GET "/en/products/4/who_bought" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
2012-08-31 09:58:35 INFO --
Started GET "/en/en/products/4/who_bought" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
2012-08-31 09:58:35 INFO --
Started GET "/en/en/en/products/4/who_bought" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
2012-08-31 09:58:35 INFO --
Started GET "/en/en/en/en/products/4/who_bought" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
2012-08-31 09:58:35 INFO --
Started GET "/en/en/en/en/en/products/4/who_bought" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
2012-08-31 09:58:35 INFO --
Started GET "/en/en/en/en/en/en/products/4/who_bought" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
2012-08-31 09:58:35 INFO --
Started GET "/en/en/en/en/en/en/en/products/4/who_bought" for 127.0.0.1 at 2012-08-31 09:58:35 +0400
また
Started GET "/assets/logo.png" for 127.0.0.1 at 2012-08-31 10:55:36 +0400
2012-08-31 10:55:36 INFO -- Served asset /logo.png - 404 Not Found (13ms)
2012-08-31 10:55:36 INFO --
Started GET "/assets/products/tea1.jpg" for 127.0.0.1 at 2012-08-31 10:55:36 +0400
2012-08-31 10:55:36 INFO -- Served asset /products/tea1.jpg - 404 Not Found (2ms)
2012-08-31 10:55:38 INFO --
Started GET "/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/assets/products/tea1" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/assets/products/tea1" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/assets/products/tea1" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/assets/products/tea1" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/en/assets/products/tea1" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/en/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/en/en/assets/products/tea1" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/en/en/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/en/en/en/assets/products/tea1" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
Started GET "/en/en/en/en/en/en/en/en/assets/logo" for 127.0.0.1 at 2012-08-31 10:55:38 +0400
2012-08-31 10:55:38 INFO --
私が行くと"http://localhost:3000/en/fdsfdsfdsfds"
、私をリダイレクトします"http://localhost:3000/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/fdsfdsfdsfds"
私はそれを取り除きたい。私は何をすべきか?