[Rails] Re: Convert HTML code of single quote (i.e. ') to text

2009-09-02 Thread Nam gi Vu
I google "reverse + html_escape" and found a thread in this forum about what I need here http://www.ruby-forum.com/topic/908. I wouldn't find that without your mention about the h() function. Thank you Mukund. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~-

[Rails] Re: Convert HTML code of single quote (i.e. ') to text

2009-09-02 Thread Nam gi Vu
Hi Mukund, Let me make it clearer to you. My situation is: I have a textbox to input the data named Username for example. The user input a string that contains the single quote, e.g. "Mukund's name", then I it was saved into MySQL database. The text was converted automatically into "Mukund&s na

[Rails] Re: Convert HTML code of single quote (i.e. ') to text

2009-09-02 Thread Mukund
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