Serve Requests with Phoenix Controllers

Phoenix uses the Model-View-Controller (MVC) design pattern. MVC manifests in different ways depending on the framework and use case. MVC has three distinct parts. Models hold and operate on the data of the application. Views represent what the user sees and interacts with. Controllers accept input from a client and coordinate all of the important logic that’s needed to serve a request. This all happens in a repetitive cycle as a user uses your application.

Rails uses this same pattern, so this should feel familiar. This pattern emerges naturally as you use Phoenix, so you don’t need to worry about the details too much right now. As you proceed through the chapter, you’ll see the separation between views, ...

Get From Ruby to Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.