diff --git a/src/gen/templates/controller/api/controller.t b/src/gen/templates/controller/api/controller.t index 02bab22e4..1982f1426 100644 --- a/src/gen/templates/controller/api/controller.t +++ b/src/gen/templates/controller/api/controller.t @@ -32,7 +32,7 @@ pub async fn {{action}}(State(_ctx): State) -> Result { pub fn routes() -> Routes { Routes::new() - .prefix("{{file_name | plural}}") + .prefix("{{file_name | plural}}/") .add("/", get(index)) {%- for action in actions %} .add("{{action}}", get({{action}})) diff --git a/src/gen/templates/controller/html/controller.t b/src/gen/templates/controller/html/controller.t index 5b1d90068..9716af6eb 100644 --- a/src/gen/templates/controller/html/controller.t +++ b/src/gen/templates/controller/html/controller.t @@ -30,7 +30,7 @@ pub async fn {{action}}( pub fn routes() -> Routes { Routes::new() - .prefix("{{file_name | plural}}") + .prefix("{{file_name | plural}}/") {%- for action in actions %} .add("{{action}}", get({{action}})) {%- endfor %} diff --git a/src/gen/templates/scaffold/api/controller.t b/src/gen/templates/scaffold/api/controller.t index f27c04ab0..382eb6a29 100644 --- a/src/gen/templates/scaffold/api/controller.t +++ b/src/gen/templates/scaffold/api/controller.t @@ -81,10 +81,10 @@ pub async fn get_one(Path(id): Path, State(ctx): State) -> Resu pub fn routes() -> Routes { Routes::new() - .prefix("{{file_name | plural}}") + .prefix("{{file_name | plural}}/") .add("/", get(list)) .add("/", post(add)) - .add("/:id", get(get_one)) - .add("/:id", delete(remove)) - .add("/:id", post(update)) + .add(":id", get(get_one)) + .add(":id", delete(remove)) + .add(":id", post(update)) } diff --git a/src/gen/templates/scaffold/html/controller.t b/src/gen/templates/scaffold/html/controller.t index 4be3fe4ec..a1b6ba6d7 100644 --- a/src/gen/templates/scaffold/html/controller.t +++ b/src/gen/templates/scaffold/html/controller.t @@ -119,12 +119,12 @@ pub async fn remove(Path(id): Path, State(ctx): State) -> Resul pub fn routes() -> Routes { Routes::new() - .prefix("{{file_name | plural}}") + .prefix("{{file_name | plural}}/") .add("/", get(list)) - .add("/new", get(new)) - .add("/:id", get(show)) - .add("/:id/edit", get(edit)) - .add("/:id", post(update)) - .add("/:id", delete(remove)) .add("/", post(add)) + .add("new", get(new)) + .add(":id", get(show)) + .add(":id/edit", get(edit)) + .add(":id", post(update)) + .add(":id", delete(remove)) } diff --git a/src/gen/templates/scaffold/htmx/controller.t b/src/gen/templates/scaffold/htmx/controller.t index a2826b420..49538c1cb 100644 --- a/src/gen/templates/scaffold/htmx/controller.t +++ b/src/gen/templates/scaffold/htmx/controller.t @@ -119,12 +119,12 @@ pub async fn remove(Path(id): Path, State(ctx): State) -> Resul pub fn routes() -> Routes { Routes::new() - .prefix("{{file_name | plural}}") + .prefix("{{file_name | plural}}/") .add("/", get(list)) - .add("/new", get(new)) - .add("/:id", get(show)) - .add("/:id/edit", get(edit)) - .add("/:id", post(update)) - .add("/:id", delete(remove)) .add("/", post(add)) + .add("new", get(new)) + .add(":id", get(show)) + .add(":id/edit", get(edit)) + .add(":id", post(update)) + .add(":id", delete(remove)) }