I am struggling to understand what is going on with our web app and unexpected behaviour on iOS. I am using Rails 184.108.40.206 with turbo-rails gem v0.7.4. When I submit a form on desktop, there’s just a single PATCH request which redirects to another location on success, or renders form errors on failure:
if @property.update(property_params) redirect_to property_path(@property) else render :property_edit end
All is good and dandy. However, when I submit a form using Safari / iOS 14.7.1, straight after PATCH request follows a GET request, which refreshes the form and clears all errors as the form view is refreshed:
Started PATCH "/properties/update/20" for 192.168.1.186 at 2021-08-25 02:04:45 +0300 Processing by PropertiesController#update as HTML [...] Started GET "/properties/edit/20" for 192.168.1.186 at 2021-08-25 02:04:46 +0300 Processing by PropertiesController#edit as HTML [...]
Does anyone have any explanation to such behaviour and why is this different from desktop? And, most importantly, if there’s a workaround?
If I disable Turbo, behaviour is valid and identical on both desktop and mobile.