In user's home page I want to show the user's phrases
.
class StaticPagesController < ApplicationController
def home
if user_signed_in?
@phrases = current_user.phrases.decorate
end
end
end
But this fails by Could not infer a decorator
. I understand the error happens because only in proper controller I can use the decorate
method.
I've read this post, but I may misunderstand it.
So if I want to use decorate
method in situation like this, what is a good way to solve it?