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 07b8bb7bfe
commit ce874e1d30
2 changed files with 2 additions and 3 deletions

View File

@ -74,7 +74,7 @@ impl Html for Form {
None => "".to_owned(),
};
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,
method = self.method,
encoding = encoding,

View File

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