rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

PATCH in form being translated to POST in api gateway #673

Closed jeremiahlukus closed 9 months ago

jeremiahlukus commented 10 months ago

Checklist

My Environment

Software Version
Operating System
Jets 4.0.2
Ruby 3.2

Expected Behaviour

Current Behavior

Using a namespaced route

  namespace :admin do
    patch "users", to: "users#update", as: :admin_users
  end 

Then a form

 <%= form_with model: @user, local: true, url: admin_users_path do |form| %>
 ...

This works locally however when deployed the on submit turns into a POST request.

changing my route to a POST and adding method: :post to the form fixed the issue for me. Im not sure what is causing this since its only when deployed. Ill look further into it and see if I can find out where this is happening and send a PR unless this is fixed in v5.

I do have a custom domain setup that might be causing the issue as well (?). Ill create a test repo with an example if this isn't fixed in v5.

Step-by-step reproduction instructions

Code Sample

Solution Suggestion

tongueroo commented 9 months ago

Fixed in v5