Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Rack 3 by renaming the name attributes of inputs #901

Merged
merged 2 commits into from
Oct 11, 2023
Merged

Commits on Oct 9, 2023

  1. Support Rack 3 by renaming the name attributes of inputs

    On the task pages, we would create runs for a task with attributes by
    having inputs named `"[task_arguments][some_attribute]"`.
    
    This is because we use `fields_for` in a `FormBuilder` initialized with
    a url, i.e. `form_with(url:)`, which doesn't have an `object_name`, so
    when nested fields are generated, there's no object name before the
    first `[`.
    
    Rack 3 changes the way form data is parsed, which causes all parameters
    to be available in `params["[task_arguments]"]` instead of
    `params[:task_arguments]`.
    
    Instead of handling this, we use `fields_for` directly on the view, not
    on the `FormBuilder` object, and we use the opportunity to rename
    `task_arguments` to `task`.
    
    Now the inputs in the task page for a run will be named
    `task[some_attribute]` instead of `[task_arguments][some_attribute]`.
    etiennebarrie committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    94498b3 View commit details
    Browse the repository at this point in the history
  2. Ignore Rack 3 warning

    This should be fixed in the next version of Capybara.
    etiennebarrie committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    78d2aab View commit details
    Browse the repository at this point in the history