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

Feature request: print a warning if you call Form#submit without specifying a button if there are multiple #624

Open
Nakilon opened this issue Nov 8, 2023 · 3 comments

Comments

@Nakilon
Copy link
Contributor

Nakilon commented Nov 8, 2023

Just spent an hour or more installing different debugging tools until found the cause of my error.

@flavorjones
Copy link
Member

Hi @Nakilon, sorry you experienced this problem. Would you be interested in attempting to implement this in a pull request?

@weshatheleopard
Copy link
Contributor

I think it can be handled by modifying Form#submit:

  def submit button = nil, headers = {}
+    warn "Multiple SUBMIT buttons available on the form." if submits.size > 1
    @mech.submit(self, button, headers)
  end

@flavorjones
Copy link
Member

@weshatheleopard Thanks, I'd love a PR for this if you have the time and inclination.

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

No branches or pull requests

3 participants