View Source mix phx.gen.solid.value (phx_gen_solid v0.3.0)

Generates Value logic for a resource.

mix phx.gen.solid.value Accounts User users id name age

The first argument is the context module followed by the schema module and its plural name.

This creates a new Value in MyApp.Accounts.Value.User. By default the allowed fields for this value will be the arguments you passed into the generator, in this case, @valid_fields [:id, :slug, :name].

Options

  • --helpers - This will generate the Value helpers context in MyApp.Value. Module name can be overridden by --value-context.
  • --value-context MODULE - This will be the name used for the helpers alias and/or helper modue name when generated. Defaults to MyApp.Value.

The generated Value relies on a few helper functions also generated by this task. By default it will be placed in your projects context folder.

For more information about the generated Value, see the Overview.

Link to this section Summary

Link to this section Functions