From 646dac4a6b50bd613a324ff777a6a3dbda196ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bue=20Gr=C3=B8nlund?= Date: Mon, 2 Mar 2020 14:18:55 +0100 Subject: [PATCH] Update README.md with instructions for namespaced decorators --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a7b65fba..ca7051b6 100644 --- a/README.md +++ b/README.md @@ -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...