In the previous chapter, we covered the basics of working with Actix to develop a server-side web application. In this chapter, you’ll more about how to work with templates as we create a tutor registration form using Actix and Tera.
Templates and forms are an important feature of web applications. They are commonly used for registration, signing in, capturing user profiles, providing payment information or know-your-customer details for regulatory purposes, and performing CRUD (create, read. update, and delete) operations on data. While capturing user input, it is also necessary to validate that data and provide feedback to the user in the case of errors. If the forms involve data updates, existing information has to be presented to the user allowing the user to change it. Elements of styling must also be added for aesthetic appeal. When forms are submitted, the form data needs to be serialized into an HTTP request, which should then invoke the right handler functions for processing and storing the form data. Finally, the user needs to be given feedback on the success of the form submission and then optionally be taken to the next screen. You’ll learn how to do all that in this chapter using Actix Web, the Tera template engine, and a few other components.