Admin declaration
Declare a resource in the admin panel.
● ● ●
use crate::entities::{users, blog, article};
use crate::formulaire::{RegisterForm, BlogForm, ArticleForm};
// This file is the SOURCE for "runique start"
// which regenerates src/admin/generated.rs automatically.
admin! {
users: users::Model => RegisterForm {
title: "Users"
}
blog: blog::Model => BlogForm {
title: "Blog articles"
}
article: article::Model => ArticleForm {
title: "Articles"
}
}
// Syntax:
// resource_name: entity::Model => FormType {
// title: "Label in the menu"
// }
// resource_name → URL segment (/admin/resource_name/)
// entity::Model → SeaORM model generated by model!
// FormType → form implementing RuniqueForm
// runique start regenerates src/admin/generated.rs on each startup.