Rails: find_by, conserving leading whitespaces

Posted by peppermonkey on Stack Overflow See other posts from Stack Overflow or by peppermonkey
Published on 2010-05-29T04:49:14Z Indexed on 2010/05/29 4:52 UTC
Read the original article Hit count: 152

Filed under:
|
|
|

Hi,

when I do the following

def somefunction
      @texts = A.find_all_by_someid(someid)
      respond_to do |format|
        format.xml  { render :xml => @texts }
      end
end

it gets the string from the db correctly, except if the string has leading whitespaces, it seems they are trimmed. Note: the whitespaces are there in the db correctly

What can I do to conserve those whitespaces? Thanks

© Stack Overflow or respective owner

Related posts about ruby

Related posts about find