Skip to content

Commit

Permalink
Merge pull request #137 from avo-hq/feature/action_arguments_as_proc
Browse files Browse the repository at this point in the history
feature: action arguments as proc
  • Loading branch information
Paul-Bob authored Nov 20, 2023
2 parents 9bac170 + ed1836c commit 3c55035
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/3.0/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,14 @@ class Avo::Resources::Fish < Avo::BaseResource
action DummyAction, arguments: {
special_message: true
}
# Or as a proc
action DummyAction, arguments: -> do
{
special_message: resource.view.index? && current_user.is_admin?
}
end
end
end
```
Expand Down

0 comments on commit 3c55035

Please sign in to comment.