Problem with special characters in input field

Hello,

In my application, a template can be created. Sometime, this template would include a special character like e.g. the Euro sign so the user will fill in €

When the field is displayed again in edit mode Rails generates following code:

<input id="account_template" name="account[template]" size="30" type="text" value="test &euro; test" />

The browser will replace the &euro; sign by the real euro sign and when the user hits save, this euro sign (so not the HTML special character code) will be saved in the database. This is not the intention.

So my question: how can I display special HTML codes as plain html code (text) which is in the initial VALUE in an input box instead of the code beeing replaced by the symbol itself?

Thank you in advance.

Axel

You need to escape the html with h()