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 Dec 2, 2024
2 parents 209c0a7 + b5b0193 commit ac1d4b0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/3.0/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ end

### Callable options

Both `name` and `message` allow a block. Within this block, you gain access to all attributes of [`Avo::ExecutionContext`](execution-context) along with the `record` (if on show view), `resource`, `arguments` and `view`.
Both `name` and `message` (and since <Version version="3.14.4" /> `confirm_button_label` and `cancel_button_label`) allow a block. Within this block, you gain access to all attributes of [`Avo::ExecutionContext`](execution-context) along with the `record` (if on show view), `resource`, `arguments` and `view`.
### Customize the name

```ruby
Expand All @@ -513,6 +513,18 @@ end
You may customize the labels for the action buttons using `confirm_button_label` and `cancel_button_label`.

<Image src="/assets/img/actions/actions-button-labels.jpg" width="699" height="325" alt="Avo button labels" />
<br>

<VersionReq version="3.14.4" /> `confirm_button_label` and `cancel_button_label` became callable options.

The blocks are executed using [`Avo::ExecutionContext`](execution-context). Within this blocks, you gain access to all attributes of [`Avo::ExecutionContext`](execution-context) along with the `resource`, `record`, `view` and `arguments`.

```ruby{2,3}
class Avo::Actions::ReleaseFish < Avo::BaseAction
self.confirm_button_label = -> { "Release #{record.name}" }
self.cancel_button_label = -> { "Cancel release on #{record.name}" }
end
```

### No confirmation actions

Expand Down

0 comments on commit ac1d4b0

Please sign in to comment.