Skip to content

Commit

Permalink
Merge pull request #68 from avo-hq/fix/actions_visible_block
Browse files Browse the repository at this point in the history
fix: actions visible block
  • Loading branch information
Paul-Bob authored Jul 21, 2023
2 parents 440a994 + 98725c3 commit 9747e71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions docs/2.0/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,16 @@ self.visible = -> { view == :new }
self.visible = -> { true }
```

Inside the visible block you can acces the following variables:
Inside the visible block you can access the following variables:
```ruby
self.visible = -> do
# You have access to:
# block
# context
# current_user
# params
# parent_model
# parent_resource
# resource
# parent_resource (can access the parent_model by parent_resource.model)
# resource (can access the model by resource.model)
# view
# view_context
end
Expand Down
7 changes: 3 additions & 4 deletions docs/3.0/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,16 @@ self.visible = -> { view == :new }
self.visible = -> { true }
```

Inside the visible block you can acces the following variables:
Inside the visible block you can access the following variables:
```ruby
self.visible = -> do
# You have access to:
# block
# context
# current_user
# params
# parent_model
# parent_resource
# resource
# parent_resource (can access the parent_record by parent_resource.record)
# resource (can access the record by resource.record)
# view
# view_context
end
Expand Down

0 comments on commit 9747e71

Please sign in to comment.