Fix the form to string conversion and set up the Delete form
This commit is contained in:
parent
07b8bb7bfe
commit
ce874e1d30
|
@ -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,
|
||||
|
|
|
@ -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")),
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue