OOZOU
Get in Touch
Back to TIL
ruby on rails

HTML forms that submit to another action

October 13, 2020

I've known for a long time that you can submit values with submit buttons so you can track which button was used to submit the form e.g.

<form action="/location1">
  <input type="submit" value="Create">
  <input type="submit" value="Create and redirect">
</form>

However, today I needed to actually submit the form to a completely differnt action. Turns out you can do this with formaction attributes

<form action="/location1">
  <input type="submit" value="Create">
  <input type="submit" value="Submit to location 2" formaction="/location2">
</form>

More on ruby on rails

ruby on railsFebruary 10, 2022

Use Pundit Policies to manage permitted parameters, defaults and per action

To manage permitted params you can add permitted\attributes and permitted\attributes\for\#{action} in your policies e.g.

ruby on railsJanuary 31, 2022

Use `requestSubmit` for form submits with Turbo

Turbo listens to submit events on form.  Hence, always use requestSubmit to submit  a form using JS.

ruby on railsJanuary 19, 2022

Ignore bundled gems for Rubocop and ESLint in GitHub Actions

Rails projects will often install gems into the vendor directory in GitHub actions so we can cache them for the consecutive runs.

Have a project in mind?

We'd love to hear what you're building.

Start a Conversationhello@oozou.com
OOZOU Logo

Bangkok · Singapore · Hong Kong

X
Facebook
Instagram
LinkedIn

Services

  • Web Development
  • AI Agents & Generative AI
  • Mobile App Development
  • Data Analytics & Engineering
  • UI/UX & Product Design
  • Digital Transformation

Company

  • About Us
  • Careers
  • Blog
  • Whitepapers
  • Case Studies
  • Today I Learned
  • Contact

More

  • Industries
  • Get an Estimate
  • Partner Network
© 2026 OOZOU. All rights reserved.
Privacy PolicyCode of ConductABAC Policy