はPhoenix.Router.resources/4
ようには見えません:shallow
OPTをサポートしていますが、これは仕事を得るでしょう:
resources "/users", UserController do
resources "/posts", PostController, only: [:index, :new, :create]
end
resources "/posts", PostController, except: [:index, :new, :create], as: :user_post
mix phoenix.routes
あなたのothのうちあなたが表示されます:
user_post_path GET /users/:user_id/posts YourApp.PostController :index
user_post_path GET /users/:user_id/posts/new YourApp.PostController :new
user_post_path POST /users/:user_id/posts YourApp.PostController :create
user_post_path GET /posts/:id/edit YourApp.PostController :edit
user_post_path GET /posts/:id YourApp.PostController :show
user_post_path PATCH /posts/:id YourApp.PostController :update
PUT /posts/:id YourApp.PostController :update
user_post_path DELETE /posts/:id YourApp.PostController :delete