TrestleAdmin / trestle

A modern, responsive admin framework for Ruby on Rails
https://trestle.io
GNU Lesser General Public License v3.0
1.94k stars 173 forks source link

Refresh view/tabs under dialog after update/save #462

Open eashman opened 1 month ago

eashman commented 1 month ago

Is there a way to force the view to refresh the tab/table under a dialog box after it is saved? This would also tie into the idea that after an edit you could optionally have the dialog close right away upon successful save.

I can't seem to find any examples that do this.

My issue is, I'm adding to the 1->many relation on a table and when i add the new item, i need to manually click refresh to see it in the main view on the source model.

eashman commented 1 month ago

In case someone sees this issue, I fixed it once I forced the master branch in my Gemfile.

I believe the problem was I had the Hotwire branch set in my code and this seems to be a bug in that particular branch.

I still would like to be able to dismiss the dialog on save/delete success optionally but at least the refresh appears to be working again on the master branch.

@spohlenz Just an FYI to test the refresh of the parent page on dialog save etc.

spohlenz commented 1 month ago

Is it possible that you've customized your index.html.erb for that admin? If so, you'll need to merge in the updates to https://github.com/TrestleAdmin/trestle/blob/hotwire/app/views/trestle/resource/index.html.erb#L12, in particular the index_turbo_frame.