resume v0.0.7 Resume.ErrorHelpers

Conveniences for translating and building error messages.

Summary

Functions

Add a base error message to an errors map

Add an error for a custom errors map

Generates tag for inlined form input errors

Convert a changeset’s errors to a Map structured like this: %{errors: %{name: ["can't be blank"]}} Supports multiple errors per field. Follows the standard Rails error return pattern

Convert a changeset’s errors to a Map structured like this: %{name: ["can't be blank"]} Supports multiple errors per field. Follows the standard Rails error return pattern

Translates an error message using gettext

Functions

add_base_error(message)

Add a base error message to an errors map.

add_base_error(errors, message)
add_error(errors, field, message)

Add an error for a custom errors map.

error_tag(form, field)

Generates tag for inlined form input errors.

for_json(changeset)

Convert a changeset’s errors to a Map structured like this: %{errors: %{name: ["can't be blank"]}} Supports multiple errors per field. Follows the standard Rails error return pattern.

to_map(changeset)

Convert a changeset’s errors to a Map structured like this: %{name: ["can't be blank"]} Supports multiple errors per field. Follows the standard Rails error return pattern.

translate_error(arg)

Translates an error message using gettext.