将Rails2命名空间路由转换为rails3

时间:2011-07-07 11:04:05

标签: ruby-on-rails-3 routes

我在Rails 2中有这个代码:

map.namespace(:admin, :path_prefix => 'refinery') do |admin|

  admin.load_gallery "/load_gallery", :controller => "pages", 
                                  :action => "load_gallery"
end

..并希望将其转换为rails 3路线。是否有人可以证明这是如何完成的?

1 个答案:

答案 0 :(得分:0)

可能看起来像

scope 'refinery', :as => :admin do
  match 'load_gallery'=> 'pages#load_gallery'
end