to: tests/fixtures/realistic/generated/controllers/{{name | snake_case }}.rs injections: - into: tests/fixtures/realistic/generated/controllers/mod.rs append: true content: "pub mod {{ name | snake_case }};" - into: tests/fixtures/realistic/generated/app.rs after: "AppRoutes::" content: " .add_route(controllers::{{ name | snake_case }}::routes())" --- #![allow(clippy::unused_async)] use axum::{extract::State, routing::get}; use rustyrails::{ app::AppContext, controller::{format, Routes}, Result, }; pub async fn echo(req_body: String) -> String { req_body } pub async fn hello(State(ctx): State) -> Result { // do something with context (database, etc) format::text("hello") } pub fn routes() -> Routes { Routes::new() .prefix("{{ name | snake_case }}") .add("/", get(hello)) .add("/echo", get(echo)) }