Ruby on rails 3 铁路3路线问题

Ruby on rails 3 铁路3路线问题,ruby-on-rails-3,routes,Ruby On Rails 3,Routes,我遇到一个问题,在路由中设置了管理子域,如下所示: constraints :subdomain => 'admin' do scope :module => "admin" do match 'articles/:id/', :to => 'articles#show' resources :articles, :events do collection do post :update_attribute_on_the_spot end

我遇到一个问题,在路由中设置了管理子域,如下所示:

constraints :subdomain => 'admin' do
scope :module => "admin" do

  match 'articles/:id/', :to => 'articles#show'

  resources :articles, :events do
    collection do
      post :update_attribute_on_the_spot
    end
  end

  root :to => "dashboard#index"

end
end
之后,关于主要网站的文章,我有:

  resources :articles, :events, :george
  match '/:year/:month/:day/:slug', :to => 'articles#show', :as => "article", :constraints => {:year => /\d{4}/, :month => /\d{1,2}/, :day => /\d{1,2}/ }
  match '/event/:year/:month/:day/:slug', :to => 'events#show', :as => "event", :constraints => {:year => /\d{4}/, :month => /\d{1,2}/, :day => /\d{1,2}/ }
我想知道我如何确保在管理子域路由生效时不使用主站点路由,从现在开始,当转到管理部分时,文章显示映射到主站点路由,因此除非删除该路由,否则管理路由将不起作用

如果有人能告诉我解决这个问题的最佳方法,那就太好了


谢谢

我没有意识到使用:声明某个内容会覆盖任何其他路由,因此只需:

match '/:year/:month/:day/:slug', :to => 'articles#show', :constraints => {:year => /\d{4}/, :month => /\d{1,2}/, :day => /\d{1,2}/ }
一切都搞定了