【发布时间】:2020-11-20 20:49:34
【问题描述】:
我有一个使用 CcpaAcknowledgmentsController 的路由/路径
/ccpa_acknowledgments
我希望路由是,但是我仍然希望它使用 CcpaAcknowledgmentsController
/customers/ccpa_acknowledgments
既然我有这两条路线...
resources :customers
resources :ccpa_acknowledgments
match '/customers/ccpa_acknowledgments', to: 'ccpa_acknowledgments#index', via: [:get]
我不断收到冲突说明 CustomersController 中的 NoMethodError。
有没有办法在不将方法/代码放入 CustomersController 的情况下获得我想要的路线?
【问题讨论】:
-
get '/customers/ccpa_acknowledgments', to: 'ccpa_acknowledgments#index' -
@IvanC 这给了我上面所说的错误。我尝试使用客户控制器
标签: ruby-on-rails ruby routes