stephskardal / rails_admin_import

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

Update error messages not showing #142

Open obreil54 opened 8 months ago

obreil54 commented 8 months ago

Hello, I know this gem is not actively maintained but I wanted to see if anyone is having the same issue and if there is a fix I can implement.

config.configure_with(:import) do |config| config.update_if_exists = true config.rollback_on_error = true end

So this is a part of what I have in my config file, the issue I am experiencing is that when it updates a record rather than creates a new one and the record it's trying to update is not passing a validation, it correctly does not update the record, however it still gives a success message which is very confusing for the user. Does anyone have a fix for this?

Additionally, in my import form the checkbox for update_if_exists just comes up on my screen as a strange line field which cannot be interracted with instead of the checkbox I can see it's supposed to be from the HTML.

monkbroc commented 8 months ago

Hi. If you can fix the issue you describe, I will happily merge the PR and release a new version of the gem.

dimvic commented 3 months ago

The problem should be that the import form has been customized and data-turbo="false" was not added to the form tag in views/rails_admin/main/import after the upgrade.

https://github.com/stephskardal/rails_admin_import/blob/079e9297e4ea38369518aceffb541b3bc06a1a21/app/views/rails_admin/main/import.html.erb#L14