mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Add documentation for denies_all
This commit is contained in:
parent
39a984f068
commit
b685acf24f
1 changed files with 8 additions and 0 deletions
|
@ -100,6 +100,14 @@ Then, to test it:
|
|||
NoMethodError: undefined method `title' for #<ArticleDecorator:0x000001020d7728>
|
||||
```
|
||||
|
||||
You may also blacklist all methods by using `denies_all`:
|
||||
|
||||
```ruby
|
||||
class ArticleDecorate < ApplicationDecorator
|
||||
denies_all
|
||||
end
|
||||
```
|
||||
|
||||
#### Using `allows`
|
||||
|
||||
A better approach is to define a whitelist using `allows`:
|
||||
|
|
Loading…
Add table
Reference in a new issue