Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Boo Yah's latest activity

Sunday, September 28 2008
867 undefined method `length' for Enumerable when calling truncate method was updated in Ruby on Rails
  • Boo Yah
    Boo Yah commented at 6:08 AM

    Peter, I ran into the same issue but solved the problem by eliminating the calls to the 'chars' function:

    
    def truncate(text, length = 30, truncate_string = "...