Wrapping Up
In this chapter, we generated a Video resource with a relationship to User and made changes to the generated code, learning a lot along the way:
-
We used contexts throughout to craft an easy-to-maintain API layer for our application.
-
We converted a private plug into a public function and shared it with our controllers and routers.
-
You learned how to migrate and roll back changes to the database.
-
We defined relationships between User and Video schemas and used functions from Ecto to build and retrieve associated data.
-
We discussed the main generators Phoenix provides to scaffold our applications.
The next chapter will take everything up a notch by exploring Ecto queries and leveraging the database constraints. When we’re done, you’ll ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access