Skip to content

simple_form @as doesn't override default form value #6490

@gregors

Description

@gregors

Environment

  • Elixir version: 1.18.4
  • Phoenix version: 1.7.21
  • Operating system: Linux

Actual behavior

When using .simple_form, If I add a for={@form} as={:test_form} I expect that on submit I would see the params submitted under "test_form" however it is ignored and continues to use the default struct name in @form. However, if I set the options on the to_form call to_form(changeset, [as: "test_form"]) it does work fine. I'm curious if this had something to do with #5901?

Expected behavior

:as should override the default form parameter name

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions