私はフェニックス1.3-dev
を見てみたかったです。私はrepositoryからフェニックスをクローンし、phoenix/installer/README.md
に続いてアーカイブを構築しました。 (参考)エリクシールフェニックスのHTMLジェネレータの文脈とは何ですか
フェニックス/インストーラ/ README.md
$ cd installer
$ MIX_ENV=prod mix archive.build
$ mix archive.install
私はmix phx.new blog
によって新しいフェニックスアプリを作成しましたが、私はmix phx.gen.html Post posts title body:text
ことにより、簡単なHTMLの足場を作成しようとしたとき、私は、エラーメッセージ、次のGET:
** (Mix) Expected the schema argument, ":\"Elixir.Company.companies\"", to be a valid module name
mix phx.gen.html and mix phx.gen.json expect a context module name,
followed by singular and plural names of the generated resource, ending
with any number of attributes:
mix phx.gen.html Accounts User users name:string
mix phx.gen.json Accounts User users name:string
The Accounts context serves as the API boundary for the given resource.
Multiple resources may belong to a context and a resource may be
split over distinct contexts (such as Accounts.User and Blog.User).
私の質問は、context
モジュールを追加する理由です。どのように役立ちますか? あなたがこれについて何か知っているなら、私が理解できるようにユースケースを記述してください。
をエラーメッセージが一目瞭然です自体。ビジネスロジックのような「エンティティ」は、データベースモデルと100%正確にマッピングするべきではありません。 – mudasobwa