3 ms·
an intriguing post with the ubiquitous todo example here’s how that looks in https://harcstack.org https://harcstack.org model Todo does Component::Red[:C:R
by librasteve 1y ago
an intriguing post with the ubiquitous todo example
here’s how that looks in https://harcstack.org https://harcstack.org
model Todo does Component::Red[:C:R:U:D] {
also does HxTodo;
has UInt $.id is serial;
has Bool $.checked is rw is column = False;
has Str $.text is column is required;
method toggle is controller {
$!checked = !$!checked;
$.^save;
self
}
method HTML {
tr
td( input :type<checkbox>, |$.hx-toggle, :$!checked),
td( $!checked ?? del $!text !! $!text),
td( button :type<submit>, |$.hx-delete, :style<width:50px>, '-'),
}
}
Todo.^create-table;
full code is here https://github.com/librasteve/Air-Play/blob/main/lib/Air/Play/Site15-TodosRed.rakumod https://github.com/librasteve/Air-Play/blob/main/lib/Air/Pla...
- all2 1y agoIs this maybe in the wrong place? How does this relate to FastHTML best practices?
- librasteve 1y agothe HARC stack is quite similar to FastHTML … both are back end libraries that leverage HTMX to help build web apps on the server side and reduce the complexity of modern web development specifically the OP references the todo example app and I thought readers here who are interested in server side web coding would like to see the same example done in another stack that is less hampered by the limitations of Python