how to make f.text_field+"<div>there is a error</div>" work
I write a helper method in applicationhelper something like this
str = f.text_field(:username) + "<div clas开发者_开发技巧s='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"> <div class="errors">username is wrong</div>
any helps? Thx!
str = f.text_field(:username) + "<div class='error'>username is wrong </div>".html_safe
精彩评论