I don't see why this is an issue for you. & is the right representation, the browser takes care of rendering that as a quote. You need to see what you are doing with the incoming data before displaying it. Also, have a look at html_escape() / h() helper function and sanitize data before database insertion. You shouldn't be storing a & into the database text field.
On Sep 2, 1:08 pm, Nam gi Vu <[email protected]> wrote: > When I save a single quote character in my database, it was converted > into & so when I read it out from database to view on my webpage, > this single quote character (and maybe many other special-treated > character) is showed as & which is not expected. I expect the " ' " > character to be displayed. > > How can I convert & to ' (single quote character) using ruby code? > > Please help. > Nam. > -- > Posted viahttp://www.ruby-forum.com/. ww.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

