views:

29

answers:

1

I write a helper method in applicationhelper something like this

str = f.text_field(:username) + "<div class='error'>username is wrong </div>"

then in my view.rhtml it shows like this

<input type="text" value="" size="30" name="user[username]" id="user_username">     &lt;div class="errors"&gt;username is wrong&lt;/div&gt;     

any helps? Thx!

+2  A: 
str = f.text_field(:username) + "<div class='error'>username is wrong </div>".html_safe
Amit
thanks Amit, rails surprises me again
juliet
It has more than often surprised me too.
Amit