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

Not working with fresh Rails 7 app? #29

Open
edooley opened this issue Aug 22, 2022 · 7 comments
Open

Not working with fresh Rails 7 app? #29

edooley opened this issue Aug 22, 2022 · 7 comments

Comments

@edooley
Copy link

edooley commented Aug 22, 2022

Perhaps I'm missing something obvious. First time using rails_admin and paper_trail. Built a fresh new Rails 7 app out of the box (rails 7.0.3, ruby 3.1.2). Got rails_admin (3.0) and paper_trail (13.0) working great. Followed instructions to enable auditing with paper_trail and History tab is showing up / tracking changes just fine. However, adding this gem and following its instructions does not show any of the Rollback columns, etc (as seen in the sample screenshots). Any ideas? Thanks!

@rikkipitt
Copy link
Member

Hey @edooley, thanks for the heads up. I'll take a look. I've only briefly used rails_admin v3 but had to quickly revert back to v2 for legacy build compatibility issues on an old project. I have a feeling there may be breaking changes in v3 that might be the cause of this. Do you happen to have a demo Rails app I could take a look at? If not, I'll try and spin one up and check it out.

@rikkipitt
Copy link
Member

Oh, looks like there's a Rails 7 / RailsAdmin v3 pull request I didn't see... Check out #26 - does that help? If so, I'll merge it in and release a new version!

@edooley
Copy link
Author

edooley commented Aug 24, 2022

Good catch @rikkipitt ! I can now see the Rollback column and "View Changes" link in each row, but it isn't launching the popup. When I visit the path it is referencing I can see the <table> with the changes it would return. I also noticed the attribute is data-url instead of data-link that is found on other rails_admin inline popups. Changing the attribute name in the browser source did not seem to make a difference when clicking though. Thoughts? Thanks!

@rikkipitt
Copy link
Member

Hey @edooley I've got a local testbed set up so I can figure out what's going on. v3 of RailsAdmin looks completely different and I think I'll need to match the new layout/styling as well as fixing the main issue.

At the moment, on the branch by @pondpaun7z, I can't see any of the paper_trail versions in the table.

The history tab shows up on individual records, but is missing from the main dashboard.

@rikkipitt
Copy link
Member

Update: I was missing some config! I forgot to enable Devise and PaperTrail within RailsAdmin itself. I'm now at the same point as you @edooley, I can see changes, but the JS is failing to trigger the modal. I will review it now!

@oloomoses
Copy link

Hi @rikkipitt, I have created this PR and I believe it solves this issue. Kindly look into it and let me know your thoughts. Thanks

@GMorisot
Copy link

I just updated from Rails 6.1 to 7.2, RailsAdmin 2 to 3.3 and PaperTrail to 16. I had some issues with Kaminari config that I needed to patch to get to the History section or RA, but still I cannot trigger the rollback.

@oloomoses this seems like a nice approach for fixing it, @rikkipitt shouldn't this be added for newer versions ?

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

No branches or pull requests

4 participants