Assistance with Schema Mix

I see. I got a bit confused and thought you wanted to only create Schema, but you’re trying to create Context and Schema.

mix phx.gen.html Foods Food delish_foods title:string ingredients:string summary:string date:integer

Foods - Context Module
Food - Schemade module
delish_foods - table name

It will create:

  • a context module in lib/app/foods.ex for the accounts API
  • lib/app/foods - folder
  • lib/app/foods/food.ex - schema module

It will also create templates, views, and a controller. It will show all the files it created in the terminal.

3 Likes