Ruby on rails 如何设置从资源到资源的路由前缀?

Ruby on rails 如何设置从资源到资源的路由前缀?,ruby-on-rails,ruby,rest,routes,Ruby On Rails,Ruby,Rest,Routes,我有这样一个rails路由配置,当我运行rake routes时,它显示了这一点,但我想perfix是restore\u链接,我该怎么做 耙道 路由配置 resources:accounts,路径:'/',参数::uid,仅:[:show]do 成员do 资源:链接,路径:'restore#u links'do#资源:帐户,路径:'/',参数::uid,仅:[:show]do 成员do 参考资料:链接,路径:'restore#links'do#你让这个工作了吗?不,我最终使用了post:uid/

我有这样一个rails路由配置,当我运行
rake routes
时,它显示了这一点,但我想perfix是restore\u链接,我该怎么做

耙道 路由配置
resources:accounts,路径:'/',参数::uid,仅:[:show]do
成员do
资源:链接,路径:'restore#u links'do#
资源:帐户,路径:'/',参数::uid,仅:[:show]do
成员do

参考资料:链接,路径:'restore#links'do#你让这个工作了吗?不,我最终使用了
post:uid/links/:id',到:“links#restore”,比如:“restore#link”
在资源块之外我想要定制的perfix而不是url路径你让这个工作了吗?不,我最终使用了
post:uid/links/:id',到:“links#restore”,比如:“restore#link”
在资源块之外我想要定制的perfix而不是url路径
restore_links POST   /:uid/links/:id(.:format)                   links#restore
resources :accounts, path: '/', param: :uid, only: [:show] do
  member do
    resources :links do
      collection do
        post ':id', to: "links#restore", as: "restore"
      end
    end
  end
end
resources :accounts, path: '/', param: :uid, only: [:show] do
  member do
    resources :links, path: 'restore_links' do # <========= `path` option
      collection do
        post ':id', to: "links#restore", as: "restore"
      end
    end
  end
end