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

Button that submits a value #3129

Closed
dereke opened this issue Oct 5, 2024 · 3 comments · Fixed by #3141
Closed

Button that submits a value #3129

dereke opened this issue Oct 5, 2024 · 3 comments · Fixed by #3141
Assignees
Labels

Comments

@dereke
Copy link

dereke commented Oct 5, 2024

I want to render a button that submits a form with a named value like this:

<button type="submit" name="remove_thing" value="some-id">Remove thing</button>

I can't seem to get this to work as you can't seem to change a button component to submit:

form.button(
  type: :submit,
  name: "remove_thing",
  value: "some-id",
  label: "Remove thing"
)

I've also tried using a form.submit() but the label overrides the value.

Is there some other way of doing this?

@lesliecdubs
Copy link
Member

Thanks for letting us know.

@camertron given your knowledge of our forms setup, could you take a look at this and weigh in?

@camertron
Copy link
Contributor

Hey @dereke, thanks for bringing this up! Seems like an oversight 😄 This PR should fix it: #3141

@dereke
Copy link
Author

dereke commented Oct 14, 2024

thanks so much for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants