I have used draper gem to generate the decorator and I have crated a decorators. I have used namespacing inside decorator folder, and I tried to access the that decorator in specific controller with decorates_assigned.
For example my folder structure is decorators/admin/example_decorator.rb
And I have added the following line in controller:
decorates_assigned :example
and in action I have written
def edit
@example = Admin::ExampleDecorator.new(Example.last)
end
But I am getting following error:
Could not infer a source for Admin::ExampleDecorator.
I am not understanding why this error is coming.
How namespaces are works in Decorator?