You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This option **only** works on **Index** pages, **NOT** on **associations**.
456
+
:::
457
+
458
+
This option leverages Turbo Stream to refresh specific table rows in response to an action. For individual records, you can use the `reload_record` alias method.
459
+
460
+
```ruby{8}
461
+
def handle(query:, fields:, **args)
462
+
query.each do |record|
463
+
record.update! active: !record.active
464
+
465
+
record.notify fields[:message] if fields[:notify_user]
466
+
end
467
+
468
+
reload_records(query)
469
+
end
470
+
```
471
+
472
+
The `reload_records` and `reload_record` methods are aliases, and they accept either an array of records or a single record.
473
+
474
+
:::code-group
475
+
```ruby[Array]{1}
476
+
reload_records([record_1, record_2])
477
+
```
478
+
479
+
```ruby[Single]{1}
480
+
reload_record(record)
481
+
```
482
+
:::
483
+
</Option>
484
+
449
485
## Customization
450
486
451
487
```ruby{2-6}
@@ -563,6 +599,25 @@ self.authorize = -> {
563
599
}
564
600
```
565
601
602
+
## Actions close modal on backdrop click
603
+
604
+
<VersionReqversion="3.14.0" />
605
+
606
+
By default, action modals use a dynamic backdrop. Add `self.close_modal_on_backdrop_click = false` in case you want to prevent the user from closing the modal when clicking on the backdrop.
Actions can have different behaviors according to their host resource. In order to achieve that, arguments can receive additional arguments as follows:
0 commit comments