|
|
|
|
|
by danjac
1863 days ago
|
|
> In the hotwire world, the encouraged approach would be to already have the html in the dom, and use a stimulus controller to show or hide it You could also use a turbo-frame here: the modal might contain data that could be expensive to pre-render in the first pass. For example, you have a list of things and you want a modal to show additional details for each thing rather than require navigation to a detail view. Those additional details might need more SQL queries that you don't necessarily want to include in your initial list render, so it makes sense to have that pulled from a separate request. Closing the modal though should not require another round-trip to the server, that can be done with Javascript. |
|