feat: Working on route and id helpers for views.

This commit is contained in:
2025-01-17 23:50:04 -05:00
parent 531a385dba
commit d8328314ed
21 changed files with 585 additions and 255 deletions

View File

@@ -17,7 +17,7 @@ struct UserForm: HTML, Sendable {
private func makeForm() -> some HTML {
form(
.id("user-form"),
.id(.user(.form)),
.class("user-form"),
.hx.post(context.targetURL),
.hx.pushURL(context.pushURL),
@@ -99,6 +99,7 @@ struct UserForm: HTML, Sendable {
}
}
// TODO: Return a route container.
var targetURL: String {
switch self {
case .create: