ruby-ui / ruby-ui/ruby_ui

DataTable nests `<form>` inside `<form>`

Open
#537 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
1k
Forks
67
Avg merge
3d 12h
Merged PRs (30d)
14

Description

  • Where: DataTableForm wraps the table; DataTableSearch and
    DataTablePerPageSelect each render their own <form> inside it.
    Snapshot data_table/full_frame holds three <form elements.
  • Effect: nested forms are invalid HTML. A browser ignores the inner
    <form> start tags when a form is in scope, so the search input and the
    per-page select become children of the outer bulk form, and
    this.form.requestSubmit() in data_table_search_controller.js submits
    the wrong form.
  • Fix: render the search and per-page forms outside the bulk form, or
    make their controls reference it with the form= attribute; re-record (on the 2.0 line)
    data_table/*.
  • 2.0 note: Herb's NestingValidator will likely reject this at compile
    time, which makes it a template adjustment in the DataTable migration.
    Fixing it on 1.6 first keeps the migration a pure port.

Surfaced by the golden HTML suite (PR #536), which pins what 1.6 renders today — this defect included. Per maintainer decision (2026-09-19) main stays as is: this is addressed on the 2.0 line, and the golden snapshot that pins it is re-recorded there with the diff reviewed.

Source: design/v2/follow-up-issues.md.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DataTableForm, DataTableSearch, DataTablePerPageSelect, and data_table_search_controller.js, then inspect the data_table/full_frame snapshot and the other data_table snapshots. Confirm the rendered form structure and how requestSubmit() selects its target. Done means the 2.0 templates avoid nested forms and the data_table/* snapshots are re-recorded and reviewed with the corrected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, ruby
Domain
frontend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.