2011-09-23 192 views
0

我想改變如下路線語法,因此它的使用Rails 3.0路線在軌道3語法從軌道2〜3 ​​

map.namespace(:admin, :path_prefix => 'refinery') do |admin| 
    admin.resources :dashboard 
    admin.disable_upgrade_message 'disable_upgrade_message', :controller => 'dashboard', :action => 'disable_upgrade_message' 
end 
+0

好的,那有什麼問題? http://guides.rubyonrails.org/routing.html – coreyward

回答

0

我會試試看兼容。該代碼是從實例採取Fernandez: The Rails 3 Way

namespace :refinery, :controller :admins do 
    resources :dashboard 
    match 'disable_upgrade_message' => 'dashboard#disable_upgrade_message' 
end 

只是一個值得注意的:您的控制器應命名爲DashboardsController,然後路線應resources :dashboards