Okay, so now that we're rocking a very thorough understanding of the connection flow and how Phoenix is handling each step along the way, let's start building our own controllers, views, routes, and templates to display something when a user goes to /polls in the browser. We'll start off by creating a new file, lib/vocial_web/controllers/poll_controller.ex. Much like our page controller, we're going to give this file a really basic structure:
defmodule VocialWeb.PollController do use VocialWeb, :controller def index(conn, _params) do render conn, "index.html" endend
Next, remember that every controller and function inside of a controller should have corresponding views and templates. Let's create lib/vocial_web/views/poll_view.ex ...