Try capture_haml
to get the processed haml_tag
value itself and append it to other text.
def the_helper
"Do Something when".html_safe +
capture_haml do
haml_tag :b, 'this happens'
end +
"after this".html_safe
end
Otherwise, haml_tag
directly writes to the view, probably not what you expected.
edit: Added html_safe
for the strings... This can be moved around the whole block, or handled in the view...