在 Rails 4 中,我试图为用户控制器中的特定操作创建自定义根,所以我希望我的用户资源仍然像他们一样,但只更改create
操作的 url 并使其成为例如/account/register
。我正在尝试按以下方式执行此操作,但似乎不起作用:
resources :users, except: [:create] # first i eliminate creation of create root
resources :users, path: "account/register", as: :users, only: [:create] # then i just try to make a custom route for only create action
我想仍然使用 users_path 而不是在视图中更改我的任何路由助手,请知道吗?