RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Customized truncate helper

Customized truncate helper In Rails truncate helper will truncates a given text after a given :length if text is longer than :length (defaults to 30).The problem is that when we truncate the string by character or word, it will cutoff the text mid-word and creating open tag problems.

Comments

We are using this one : http://gist.github.com/113998 with great success :).

I’m using this one: http://pastie.textmate.org/487265

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in