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