Skip to content

Commit

Permalink
addcontroller hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Jul 4, 2023
1 parent 60b46c6 commit c8c66b8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/2.0/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ end
```
:::

:::option `save_model_action`
Override this method to change how a record is being saved.

```ruby
def save_model_action
@model.save!
end
```
:::

## Destroy methods
For the `destroy` method, you can modify the `after_destroy_path`, the messages, and the actions both on success or failure.

Expand Down Expand Up @@ -194,4 +204,12 @@ end
```
:::

:::option `destroy_model_action`
Override this method to change how a record is being destroyed.

```ruby
def destroy_model_action
@model.destroy!
end
```
:::

0 comments on commit c8c66b8

Please sign in to comment.