的routes.rb
MyApp::Application.routes.draw do
root :to => 'home#index'
localized do
resources :cars
resource :admin, :controller => :admin
resource :dashboard do
member do
match 'vlk', :as => :vlk
end
end
end
end
routes.yml
cs:
cars: 'auta'
admin: 'admincesky'
routes:
dashboard:
as: 'novy'
path_names:
new: 'cesky_member'
vlk: 'tzz_cesky'
named_routes_path:
vlk: 'tzz_cesky'
2.其次,我尝试了下一个gem' route_translator'我无法运行' route_translator'宝石我收到此错误
/ruby-1.9.2-p320/gems/actionpack-3.0.14/lib/action_dispatch/routing/route.rb:25:in `initialize': can't convert Array into String (TypeError)
如果我在routes.rb文件末尾添加行
Dt::Application.routes.translate_from_file('config/locales/routes.yml')
答案 0 :(得分:1)