2

In pre 1.0 versions of the draper gem we were able to use the decorates method explicitly specifying the class to be decorated (e.g. when the class is namespaced):

MyClassDecorator < Draper::Base
   decorates :my_class, :class => Namespace::MyClass
   ...

Now (draper 1.3) decorates does not accept additional parameters. But just omitting the :class option leads to "uninitialized constant MyClass".

How do we decorate classes whose class names cannot be deducted by draper automatically?

Alexander Presber
  • 6,429
  • 2
  • 37
  • 66

1 Answers1

5

Found the answer here: https://github.com/drapergem/draper/issues/587

It is possible to specify the class instead of a symbol:

MyClassDecorator < Draper::Base
  decorates Namespace::MyClass
  ...
Alexander Presber
  • 6,429
  • 2
  • 37
  • 66