Skip to content

Custom Controller Routing #934

Answered by s0kil
s0kil asked this question in Q&A
Discussion options

You must be logged in to vote

Here are the HasPath and CanRoute instances for custom routing, they belong in the Web.Routes or Admin.Routes module

instance HasPath CategoriesController where
   pathTo CategoriesAction = "/categories"
   pathTo NewCategoryAction = "/category/new"
   pathTo CreateCategoryAction = "/category/create"
   pathTo ShowCategoryAction { categoryId } = "/category/" <> tshow categoryId
   pathTo EditCategoryAction { categoryId } = "/category/edit/" <> tshow categoryId
   pathTo UpdateCategoryAction { categoryId } = "/category/update/" <> tshow categoryId
   pathTo DeleteCategoryAction { categoryId } = "/category/delete/" <> tshow categoryId

instance CanRoute CategoriesController where
   parseRo…

Replies: 3 comments

Comment options

s0kil
Jun 23, 2021
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by s0kil
Comment options

s0kil
Jun 24, 2021
Collaborator Author

You must be logged in to vote
0 replies
Comment options

s0kil
Jun 29, 2021
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant