stephskardal / rails_admin_import

Rails Admin Import functionality
http://www.endpoint.com/
MIT License
160 stars 122 forks source link

Errors not showing with latest Turbo-enabled Rails Admin v3 #141

Closed rnevius closed 5 months ago

rnevius commented 1 year ago

Rails Admin switched to Turbo Drive in version 3.0: https://github.com/railsadminteam/rails_admin/blob/master/CHANGELOG.md#300rc---2022-02-06

As a result, form submissions no longer show/flash error messages, and the browser console shows the following error:

Error: Form responses must redirect to another location

Adding data: { turbo: false } to the form_tag in a fork of this plugin "fixes" the problem for now, but it's not ideal.

nikos83 commented 1 year ago

I have the same issue as @rnevius mentioned. Forked and changed

# app/views/rails_admin/main/import.html.erb
# from
<%= form_tag import_path(@abstract_model), :multipart => true, class: 'form-horizontal denser' do %>
# to
<%= form_tag import_path(@abstract_model), :multipart => true, class: 'form-horizontal denser', data: { turbo: false } do %>

Now it works but ... the issue is still there :) Thanks @rnevius

monkbroc commented 1 year ago

Hello! I am not a daily user of the gem anymore, but I will happily take a PR with a fix and release a new version of the gem. @nikos83 @rnevius can either of you fix the issue you reported?

nanjakkun commented 5 months ago

@monkbroc Hello, I have the same issue and I made a PR. Could you have a look?

https://github.com/stephskardal/rails_admin_import/pull/143