Flash Messages

Flash messages are used to create notices and alerts, e.g. on form submission.

Setting form notice/alert values through FormConfiguration

You can add values for flash messages as part of form configuration, for example:

---
name: signup_form
resource: User
fields:
  email:
  password:
flash_notice: You have successfully signed up
flash_alert: Please fix validation errors
---

Interpolation

Values for flash keys are processed using a Liquid parser, so they can be interpolated in the context of the current form:

---
name: signup_form
resource: User
fields:
  email:
  password:
  first_name:
    validation: { presence: true }
flash_notice: 'Thank you {{ form.first_name }}, you have successfully signed up!'
flash_alert: Please fix validation errors
---

Displaying flash messages

Messages can be displayed on page with context variable

{{ context.flash['notice'] }}
{{ context.flash['alert'] }}

Questions?

We are always happy to help with any questions you may have. Check out our Help page, or contact us.