I’ve got a partial view that I can use to show several types of models. The only difference I have between objects is a subtitle otherwise the partial is unchanged between objects. I’ve gone with:
module TitleHelper def title(object) if object.is_a? SomethingA #show this elsif object.is_a? SomethingB #show that else #show default end end end
However, I’ve read that is_a? is something to be avoided. How should I be handling this snippet of view logic?