diff --git a/docs/customizing_dashboards.md b/docs/customizing_dashboards.md index c23e88a4d2..e4299376c4 100644 --- a/docs/customizing_dashboards.md +++ b/docs/customizing_dashboards.md @@ -157,3 +157,16 @@ end ```` [define your own]: /adding_custom_field_types + +## Customizing Actions + +To enable or disable certain actions you could override `valid_action?` method in your dashboard controller like this: + +```ruby +# disable 'edit' and 'destroy' links +def valid_action?(name, resource = resource_class) + %w[edit destroy].exclude?(name.to_s) && super +end +``` + +Action is one of `new`, `edit`, `show`, `destroy`.