Last active
April 19, 2018 14:24
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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