1
我寫一個輔助方法在applicationhelper像這樣如何讓f.text_field + 「<div>there is a error</div>」 工作
str = f.text_field(:username) + "<div class='error'>username is wrong </div>"
然後在我的view.rhtml它這樣表示
<input type="text" value="" size="30" name="user[username]" id="user_username"> <div class="errors">username is wrong</div>
任何幫助?謝謝!
謝謝艾米特,鐵軌讓我感到驚喜 – juliet 2010-08-31 02:45:45