You’re not receiving notifications from this thread.
Remote form - update partial in Rails 6
This may sound super dumb but is there a new and improved way to remotely update partials in Rails 6. I've used the 'update.js.erb' file before to render the partial but for rails 6 is there an updated pattern or best practice we should be following?
This actually might change very soon whenever the "New Magic" DHH keeps talking about gets released.
There are a few good options currently that I like using:
Write a Stimulus JS controller that makes that AJAX request and replaces the partial in the DOM. Rails just needs to render the partial and return that without the layout.
For realtime, you can use CableReady to broadcast the partial from the backend to the frontend with ActionCable. The partial would just need an ID so that it can be searched for and replaced.