Rails路由 - 命名的收集路由 - 需要解释

时间:2013-03-05 09:19:09

标签: ruby-on-rails-3.2 rails-routing

我需要一些解释:

为什么这条路线

resources :users, :controller => "frontend/users", only: [:new, :create] do
    member do
      get "activate"
    end
  end

工作正常,

为什么这个会让我错过一个模板错误?

namespace :backstage do
    match '', to: "dashboard#index", as: '/'
    get 'users/active' => 'users#active', :as => 'active_users'
    resources :users do
      collection do
        match 'search' => 'users#search', :via => [:get, :post], :as => :search
      end
      resources :profiles
    end
end

如何让它按预期工作?

感谢您的帮助

干杯

编辑 - 错误消息是

Missing template backstage/users/search, application/search with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "C:/RailsApps/novaxones/app/views"

使用Rails 3.2.11和Ransack 0.7.2

0 个答案:

没有答案