How to Build The Ratings Components

Let's learn how to implement state management in Phoenix.

We'll cover the following

Before we build

We’re going to do very much the same thing we did with demographics—let the SurveyLive LiveView orchestrate the state and appearance of the overall survey and devise a set of components to handle the state of the product ratings.

We’ll have the SurveyLive template implement some logic to display product rating components only if the demographic form is complete and the demographic exists. If there’s an existing demographic, we’ll render a ratings index component that will iterate over the products and render the rating details or rating form accordingly.

Again, here’s roughly what a user will see if they’ve not yet entered demographic data:

Get hands-on with 1200+ tech skills courses.