Skip to content

Commit

Permalink
Merge branch 'main' of github.com:avo-hq/docs.avohq.io
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Jul 8, 2024
2 parents e38c9b7 + f8d9079 commit 491b193
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions docs/3.0/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,32 @@ This type of response becomes useful when you are working with a form and need t

`close_modal` will flash all the messages gathered by [action responses](#action-responses) and will close the modal using turbo streams keeping the page still.

```ruby
```ruby{7}
class Avo::Actions::CloseModal < Avo::BaseAction
self.name = "Close modal"
self.standalone = true
self.visible = -> {
true
}
def handle(**args)
# do_something_here
succeed "Modal closed!!"
close_modal
# or
do_nothing
end
end
```
:::

:::option `do_nothing`
`do_nothing` is an alias for `close_modal`.

```ruby{7}
class Avo::Actions::CloseModal < Avo::BaseAction
self.name = "Close modal"
def handle(**args)
# do_something_here
succeed "Modal closed!!"
do_nothing
end
end
```
Expand Down

0 comments on commit 491b193

Please sign in to comment.