Fix the form to string conversion and set up the Delete form

This commit is contained in:
Savanni D'Gerinel 2023-10-25 22:52:03 -04:00
parent 41bbfa14f3
commit 9c75c84720
2 changed files with 2 additions and 3 deletions

View File

@ -74,7 +74,7 @@ impl Html for Form {
None => "".to_owned(), None => "".to_owned(),
}; };
format!( format!(
"<form action=\"{path}\" method=\"{method}\" {encoding}\n{elements}\n</form>\n", "<form action=\"{path}\" method=\"{method}\" {encoding}>\n{elements}\n</form>\n",
path = self.path, path = self.path,
method = self.method, method = self.method,
encoding = encoding, encoding = encoding,

View File

@ -102,9 +102,8 @@ pub fn thumbnail(info: &FileInfo) -> Container {
) )
.with_html( .with_html(
Form::new() Form::new()
.with_path(&format!("/{}", *info.id)) .with_path(&format!("/delete/{}", *info.id))
.with_method("post") .with_method("post")
.with_html(Input::new("hidden", "_method").with_value("delete"))
.with_html(Button::new("Delete")), .with_html(Button::new("Delete")),
), ),
) )