How to use generator phx.gen.html with no schema and context?

Hi I’ve tried every combination of

mix phx.gen.html About about --no-context --no-schema

I took out about and About in several combinations and it doesn’t work. I’ve read the doc and I’ve googled for the answer. The answer I’ve found is not to use generator. Which is great if I wasn’t lazy and am now super curious how to get those --no-context and --no-schema flags working with mix phx.gen.html.

Thanks for your time!

1 Like

You still need to pass the context name, schema name and fields:

$ mix phx.gen.html CMS About abouts content:string --no-context --no-schema
* creating lib/foo_web/controllers/about_controller.ex
* creating lib/foo_web/templates/about/edit.html.eex
* creating lib/foo_web/templates/about/form.html.eex
* creating lib/foo_web/templates/about/index.html.eex
* creating lib/foo_web/templates/about/new.html.eex
* creating lib/foo_web/templates/about/show.html.eex
* creating lib/foo_web/views/about_view.ex
* creating test/foo_web/controllers/about_controller_test.exs

basically the generator skips creating context and schema files and you need to implement them yourself.