Alkemist v1.0.1-rc Alkemist.Assign
Provides helper functions for generic CRUD assigns
Link to this section Summary
Functions
Creates all the necessary values for the CSV generation
Creates the view assigns for the new and edit actions
Creates the default assigns for a controller index action. Params:
- params - the controller route params
- resource - the resource module
- opts - a KeywordList with options
Creates the assigns for the show view Params:
- resource - a single entry from the DB
Link to this section Functions
Link to this function
csv_assigns(params, resource, opts \\ [])
Creates all the necessary values for the CSV generation
Link to this function
form_assigns(resource, opts \\ [])
Creates the view assigns for the new and edit actions
Link to this function
format_action(params)
Link to this function
format_action(action, singular)
Link to this function
get_default_columns(resource)
Link to this function
index_assigns(params, resource, opts \\ [])
Creates the default assigns for a controller index action. Params:
- params - the controller route params
- resource - the resource module
- opts - a KeywordList with options
Opts:
- repo - the Ecto.Repo to use for the lookup
- query - an Ecto.Query. By default, the resource will be used
- preload - list of associations to preload
- collection_actions - global actions (without ID)
- member_actions - actions available for a single resource
- singular_name - Label for a single resource. By default the singular of the db table is used
- plural_name - Pluralized name for labels. By default this is the db table name
- search_provider - Provide a custom module for your search
Link to this function
show_assigns(resource, opts \\ [])
Creates the assigns for the show view Params:
- resource - a single entry from the DB