avo-hq/avo

Make action forms better

Open

#2,670 opened on Apr 9, 2024

View on GitHub
 (3 comments) (0 reactions) (1 assignee)Ruby (308 forks)user submission
EnhancementHelp wantedJavascript

Repository metrics

Stars
 (1,778 stars)
PR merge metrics
 (Avg merge 1d 6h) (67 merged PRs in 30d)

Description

Feature

  • Create a stimulus controller that disables the submit form until all required fields have content.
  • Associate fields with errors coming from the backend and render errors before calling the handle method (as suggested by Paul Bob on Discord).

Current workarounds

def handle...
  if some_field.blank?
    error "Something happened"
    keep_modal_open
    return
  end
end

Additional context

https://discord.com/channels/740892036978442260/1226288821780484137

Contributor guide