Skip to Content
Programming Phoenix 1.4
book

Programming Phoenix 1.4

by Chris McCord, Bruce Tate, Jose Valim
October 2019
Intermediate to advanced content levelIntermediate to advanced
358 pages
8h 22m
English
Pragmatic Bookshelf
Content preview from Programming Phoenix 1.4

Seeding and Associating Categories

Let’s associate videos and categories. The first step is to make sure categories actually exist in our database by using seed data. Then we will change our web interface to allow users to pick the category for a new video.

Setting Up Category Seed Data

We need to define a handful of initial categories for our application to use. We could start an IEx session and directly invoke the repository to do that, but this approach has some issues. If we do this work manually, each teammate will have to do the same as soon as they want to take our application for a spin. Once our application grows in size, having to populate each table in our application with relevant data can get long and tedious.

Furthermore, categories ...

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.
Start your free trial

You might also like

Programming Rust, 2nd Edition

Programming Rust, 2nd Edition

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall
The Rust Programming Language, 2nd Edition

The Rust Programming Language, 2nd Edition

Steve Klabnik, Carol Nichols
The Go Programming Language

The Go Programming Language

Alan A. A. Donovan, Brian W. Kernighan

Publisher Resources

ISBN: 9781680507324Errata Page