I have a decorator that returns either a string, or a collection.
In my view, I want to display the return of this decorator method.
class MyDecorator < Draper::Decorator
def stuff
if condition
'some string'
else
render model.some_collection
end
end
end
Now in my view I want to render the string if it's a string, or render the collection.
= my_object.stuff
Unfortunately I cannot access the render
method inside Draper::Decorator
. Thoughts?