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
You can add a get
inside the do
block of resources
.
resources "/tasks", TaskController do
get "/implement", TaskController, :implement
end
$ mix phoenix.routes
task_path GET /tasks MyApp.TaskController :index
task_path GET /tasks/:id/edit MyApp.TaskController :edit
task_path GET /tasks/new MyApp.TaskController :new
task_path GET /tasks/:id MyApp.TaskController :show
task_path POST /tasks MyApp.TaskController :create
task_path PATCH /tasks/:id MyApp.TaskController :update
PUT /tasks/:id MyApp.TaskController :update
task_path DELETE /tasks/:id MyApp.TaskController :delete
task_task_path GET /tasks/:task_id/implement MyApp.TaskController :implement