Closed ArturT closed 9 months ago
I tried reproducing the above issue with shakapacker/webpack, but I had no issues (also tried searching my users).
I think it works for me because with npm packages, a package can have a different version than the main project when required as an indirect dependency. While my app uses turbo-rails 8.x (located directly in node_modules/@hotwired/), rails_admin uses version 7.x which is in node_modules/rails_admin/node_modules/@hotwired/)
The versions:
So, as long as you're using the client scripts via yarn/npm instead of the sprockets you should be fine.
I use the sprockets gem, the terser gem, and the importmap-rails gem.
The originally reported issue seems to be fixed by https://github.com/hotwired/turbo/pull/1077.
The originally reported issue seems to be fixed by hotwired/turbo#1077.
Yes. I confirm updating the turbo-rails gem fixes the issue. Thank you.
Turbo 8 has been released in the turbo-rails gem
2.0.0.pre.beta.1
.Turbo 8 has a few cool features and I wanted to test this with the Rails app but the rails_admin depends on turbo-rails < 2 (see
spec.add_dependency 'turbo-rails', '~> 1.0'
inrails_admin.gemspec
).Reproduction steps
I updated the rails_admin.gemspec file to:
I was able to run the Rails app with rails_admin and the latest turbo-rails. I'm using turbo-rails directly from github because they did some fix (the bug prevented to start my Rails app fix: https://github.com/hotwired/turbo-rails/pull/523 ) that has not been released to rubygems yet.
Describe the bug
When it comes to rails_admin. While I'm using Turbo 8 (turbo-rails 2.x gem) I found an issue. When I visit the http://localhost:3000/admin/user In the search bar I type a user name and click on Refresh button then nothing happens. I get the error in the Chrome console:
Workaround
In order to keep using rails_admin and the latest turbo-rails 2.x I disabled Turbo in the rails_admin dashboard.
I added:
Now I can search records in the rails_admin panel. I hope this workaround can be helpful for someone looking for a temporary solution to use both rails_admin and turbo-rails 2.x in your Rails app.
Expected behavior rails_admin works with the turbo-rails 2.x gem.
Additional context
rails
version: 7.0.8rails_admin
version: 3.1.2rails_admin
npm package version: not usingLet me know if there is something I could help to bring turbo-rails 2.x to rails_admin. Thanks.