Is there any way to define custom routes in Phoenix?

后端 未结 4 1198
夕颜
夕颜 2021-02-05 08:59

Let\'s say I want to create a resources with adding a couple of custom actions to it, the analogue in rails is:

resources :tasks do
  member do
             


        
4条回答
  •  梦如初夏
    2021-02-05 09:13

    It looks like a collection route would have to be:

    get "tasks/implement", Tasks, :implement # collection route
    

    I don't think phoenix has member / collection resource routes like rails does.

    I found this link were they talk about collection routes a little and give an example like the one I included above:

    https://github.com/phoenixframework/phoenix/issues/10

提交回复
热议问题