Skip to content

Commit

Permalink
Merge pull request #878 from Aerotune/master
Browse files Browse the repository at this point in the history
Update README.md with instructions for namespaced decorators
  • Loading branch information
y-yagi authored Aug 25, 2024
2 parents 472892e + ec99979 commit 3faf8e8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ class ArticleDecorator < Draper::Decorator
end
```


To decorate a model in a namespace e.g. `Admin::Catalogue` place the decorator under the
directory `app/decorators/admin` in the same way you would with views and models.

```ruby
# app/decorators/admin/catalogue_decorator.rb
class Admin::CatalogueDecorator < Draper::Decorator
# ...
end
```

### Generators

To create an `ApplicationDecorator` that all generated decorators inherit from, run...
Expand Down

0 comments on commit 3faf8e8

Please sign in to comment.