Jory
Jory

Reputation: 21

How to disable context in Elixir/Phoenix generators and models completely?

Phoenix has a generator:

  mix phx.gen.html Accounts User users name:string age:integer

I don't want to use a context for my models, neihter do I want to provide its name. How to disable it?

Upvotes: 2

Views: 467

Answers (2)

cleaver
cleaver

Reputation: 370

You can still use the old generators as they were in 1.2 and earlier

mix phoenix.gen.html User users name:string age:integer

Note: use phoenix.gen.html instead of phx.gen.html. More at the Phoenix 1.3 documentation.

The 1.3 generators were named differently so that they could be used side by side with the old.

Upvotes: 1

Azul
Azul

Reputation: 581

I believe you want to use the --no-context flag.

Generating without a schema or context file

Upvotes: 0

Related Questions