开发者

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">     &lt;div class="errors"&gt;username is wrong&lt;/div&gt;     

any helps? Thx!


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜