Elmer v0.0.11 Mix.Tasks.Elmer.Gen.Resource

Creates a complete Elm resource (Model, Update, Msgs, Listview, Editview, Cmds).

Summary

Functions

Creates a new elm Model in your elm path

Functions

run(args)

Creates a new elm Model in your elm path.

Run with mix elmer.gen.model <module name> <args>

Args are similar to phoenix gen arguments where they are in the format “Model Pluralmodel field1:type1 fieldN:typeN”

Example: mix elmer.gen.edit_view Players Player players name:string level:integer

  • Model is the name of the model you want to generate
  • Types will be mapped from elixir (ecto types) to elm

    • :boolean -> Boolean
    • :integer -> Int
    • :float -> Float
    • :string -> String
    • :map -> Record