If it is a lot of HTML I would definitely go for extracting the partial. Nothing writes and reads HTML cleaner than HAML in my personal opinion.
If it is a bunch of string interpolation, composing a lot of values, I sometimes use helpers to clean up my view, but they would always return strings, I never use concat
in my helpers, this makes my helpers better testable as well (just check if the string result is what I expect it to be).
So, for your example it would be
def long_string(str)
result = []
result << t("some.key")
result << content_tag(:b, t("other.key.#{string}"))
result << content_tag(:i, string)
result.join(" ").html_safe
end
and in your view you can just write
%p= long_string('whatevvva')
Hope this helps.