Skip to main content

doido_controller/
helper.rs

1//! Controller helpers — auxiliary modules imported by controllers.
2//!
3//! Helpers live in `app/helpers/` (e.g. `posts_helper.rs` with `PostsHelper`).
4//! Mark the struct with `#[helper]` and call its methods from controller actions.
5
6/// A controller helper type. The `#[helper]` attribute generates the implementation
7/// from the struct name (`PostsHelper` → `"posts_helper"`).
8pub trait Helper {
9    /// Snake-case helper name used for convention-based lookup.
10    fn helper_name() -> &'static str;
11}