phoenix_mtm v0.2.0 PhoenixMTM.Helpers

Provides HTML helpers for Phoenix.

Summary

Functions

Generates a list of checkboxes and labels to update a Phoenix many_to_many relationship

Functions

collection_checkboxes(form, field, collection, opts \\ [])

Generates a list of checkboxes and labels to update a Phoenix many_to_many relationship.

Example

<%= PhoenixMTM.Helpers.collection_checkboxes f, :tags, Enum.map(@tags, fn tag -> {tag.name, tag.id} end), selected: Enum.map(f.data.tags, &(&1.id)) %>