diff --git a/docs/customizing_controller_actions.md b/docs/customizing_controller_actions.md index e2f2f4d342..c0f058c19a 100644 --- a/docs/customizing_controller_actions.md +++ b/docs/customizing_controller_actions.md @@ -41,3 +41,16 @@ class Admin::FoosController < Admin::ApplicationController # end end ``` + +## 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`. diff --git a/docs/customizing_dashboards.md b/docs/customizing_dashboards.md index d1a535730e..4d4bf412bf 100644 --- a/docs/customizing_dashboards.md +++ b/docs/customizing_dashboards.md @@ -265,19 +265,6 @@ en: other: Happy Customers ``` -## 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`. - ## Collection Filters Resources can be filtered with pre-set filters. For example if we added: