我想更改以下路由语法,以便它与Rails 3.0兼容
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 :(得分: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
。