Removing   in Rails

Posted by Trip on Stack Overflow See other posts from Stack Overflow or by Trip
Published on 2010-06-08T18:26:18Z Indexed on 2010/06/08 18:42 UTC
Read the original article Hit count: 115

Filed under:

I am trying to remove all  's in my model with the following method :

def about_us_sans_spaces
  self.about_us = replace(self.about_us, " ", " ")
end

Except! it turns out 'replace' isn't a method in rails. How would you remove the  s?

Mind you, I have already tried sanitized, simple_format. My view looks like this right now:

= truncate(sanitize(simple_format(organization.about_us_sans_spaces), :tags => ''), 125).titleize

© Stack Overflow or respective owner

Related posts about ruby-on-rails