concept view template in category elixir

appears as: view template
Phoenix in Action

This is an excerpt from Manning's book Phoenix in Action.

In order to see the list of items in your fake repo, you need to modify the controller and the view template. In the controller, you need to bind the result of the Auction.get_items/0 function call to a variable, and then pass that to the view template. In the template, you need to iterate through that list of items and display information about each one.

This will make a new Bid changeset available in the view template. The Bid changeset allows your form to track changes, errors, and validations.

11.3.3. Adding the list of bids to the view template

Your most recent change preloads the associations for an item so they’re ready to be used in the view template. All you need to do now is iterate through the bids and output the information you’d like to see. Along with displaying the list of bids, you’ll add a bit of extra formatting to keep the page from getting too busy (see figure 11.8).