Try this for your helper method,
def send_link_or_tag(link=true)
if link
link_to root_path, class: 'to-block' do
yield
end
else
content_tag :div do
yield
end
end
end
This will yield the content in an a
or div
tag from the block defined in your view.