是否可以在嵌套路由中重命名父参数?

Is it possible to rename parent param in nested routing?

  resources :client, only: [] do
    get :info
  end

使用以上路线系统会生成一条路线/client/:client_id/info(.:format)

我想知道是否可以将 :client_id 更改为 rails 中的 :customer_id

resources :client, as: :customer, only: [] do
  get :info
end

会生成/client/:customer_id/info

注意: 您必须使用 customer_info_path 而不是 client_info_path