Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All buttons except "Save" work incorrectly on 3.0.0.rc #3468

Closed
ha4gu opened this issue Feb 13, 2022 · 4 comments
Closed

All buttons except "Save" work incorrectly on 3.0.0.rc #3468

ha4gu opened this issue Feb 13, 2022 · 4 comments

Comments

@ha4gu
Copy link

ha4gu commented Feb 13, 2022

Describe the bug

When create and update an instance through Rails Admin, "Save and add another", "Save and edit", and even "Cancel" buttons always just save the instance and moves to the list page, as same as using "Save" button.

This behavior didn't occur on 3.0.0.beta2. Occurs on 3.0.0.rc, and current master.

Reproduction steps

Create a new Rails application and just install and setup Rails Admin 3.0.0.rc following the installation process written on the README.

Expected behavior

  • "Save and add another": Opens "Add new" page automatically just after saving the instance.
  • "Save and edit": Opens "Edit" page automatically just after saving the instance.
  • "Cancel": Moves to the list page not saving the instance.

Additional context

rails 6.1.4.6
rails_admin 3.0.0.rc and current master (3d7f3b3), with config.asset_source = :webpacker in config/initializers/rails_admin.rb
turbo-rails 1.0.1
webpacker 5.4.3

mshibuya added a commit that referenced this issue Feb 13, 2022
@mshibuya
Copy link
Member

Sorry for the issue, this is annoying. Should be related to the introduction of Turbo Drive #3461.
I've just created a branch containing a possible fix for this, could you try and see if it works or not?
https://github.com/railsadminteam/rails_admin/tree/fix-3468

@ha4gu
Copy link
Author

ha4gu commented Feb 14, 2022

Thank you so much for your quick reply and fix.
Unfortunately, however, it seems that this issue still occurs on Rails Admin on the fix-3468 branch.

I tried this branch on the application I have tested yesterday, and also on a new, minimum application newly created for reproducing this issue (https://github.com/ha4gu/rails-admin-3468).
And I use Google Chrome 98.0.4758.80 and Mozilla Firefox 97.0.
In every pattern, this wrong behavior happens....

@mshibuya
Copy link
Member

mshibuya commented Feb 15, 2022

Since you're using Webpacker, you need to update JS dependency as well.

By using your repo I could confirm that this fix works, so pushed it to the master. You can try it by changing the package.json to

-    "rails_admin": "3.0.0-rc",
+    "rails_admin": "git+ssh://[email protected]/railsadminteam/rails_admin.git",

Thank you for reporting!

@ha4gu
Copy link
Author

ha4gu commented Feb 15, 2022

Oh sorry, oops, I made a silly mistake.
Now I confirmed your fix have solved the issue perfectly too.
Thank you so much for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants