【发布时间】:2020-10-08 21:23:13
【问题描述】:
按照这里的教程进行操作
https://www.youtube.com/watch?v=THUG8J3xSYw&list=PLtTtLKRL6UYGxOHToRYnXBynon5plZ7Jd&index=1
尝试使用脚手架生成模型。
我在终端上试过这个
mix phx.gen.model Comment comments body:text post_id:references:posts
但我在终端中得到以下信息:
** (Mix) The task "phx.gen.model" could not be found. Did you mean "phx.gen.html"?
我在终端上试过了
mix phoenix.gen.model Comment comments body:text post_id:references:posts
但我在终端中得到以下信息:
** (Mix) The task "phoenix.gen.model" could not be found
【问题讨论】:
-
本教程已经过时了,我建议使用更新的资源。如果您想了解更多关于 1.3 中模型被替换为上下文的原因,可以查看this talk。