Ruby/html trick: wrap long strings with invisible wordwrap characters
def wrap_long_string(text,max_width = 20) (text.length < max_width) ? text : text.scan(/.{1,#{max_width}}/).join(“<wbr>”) end
I am a photographer, entrepreneur, software engineer, guitarist, climber, and telemark skier
This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.
Enterprise intelligence with prediction markets
Find out what your team, colleagues and partners really know about the future — and leverage their knowledge to improve business decisions.
Reach me at yan at pritzker.ws
def wrap_long_string(text,max_width = 20) (text.length < max_width) ? text : text.scan(/.{1,#{max_width}}/).join(“<wbr>”) end
© Yan Pritzker. Powered by WordPress using a DePo Clean Theme modified by Yan Pritzker.