我看到了一个“railscasts”演员表,并没有像他们告诉我的那样。这是我的 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"
我想摆脱它。我该怎么办?