Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add instructions of how to disable some actions.
  • Loading branch information
rozhok committed Jul 19, 2017
1 parent a2a6931 commit 72918ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/customizing_dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

0 comments on commit 72918ea

Please sign in to comment.