The essence of the problem lies in the fact that there is a form on the html page, in which there can be a different number of input fields. Is it possible somehow to get all the values entered by the user in those fields?
I can get the value if it is known that the input field, for example, is only one:
#[derive(FromForm)]
pub struct TableNameInput {
pub table_name: String,
}
#[post("/create_table", data = "<table_name>")]
pub fn post_create_table(table_name: Form<TableNameInput>) -> Html<String> {
let table = table_name.into_inner().table_name;
let s = create_table(String::from("new_db"), table);
Html(format!("<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<title>Document</title>
<script src=\"../static/js/index.js\"></script>
</head>
<body>
<link rel=\"stylesheet\" type=\"text/css\" href=\"../static/styles/style.css\"></link>
<h3>{}</h3>
</body>
</html>", s))
}
In this code i take table's name from input field and insert it in "h3" tag. But how can i get all entered values if i don't know number of input fields.