Fix for link_to_if and link_to_unless generate links with block

Fixes #14830