Skip to content

Instantly share code, notes, and snippets.

@danhalliday
Last active April 19, 2018 14:24
Show Gist options
  • Save danhalliday/2271d61c2cd4e2f4021b18ea1969746b to your computer and use it in GitHub Desktop.
Save danhalliday/2271d61c2cd4e2f4021b18ea1969746b to your computer and use it in GitHub Desktop.
Quick-and-dirty idea to prevent a last word wrapping to a new line
def prevent_ugly_wrap(string)
string.reverse.sub(" ", " ".reverse).reverse.html_safe
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment