2015-04-15 45 views
1

我有一個小問題。我想在從數據庫中提取的輸入文本字段中添加值。使用Rails在輸入文本字段中添加值3

假設我有一個如下所示的輸入字段。

<input type="text" class="form-control" placeholder="Receipt No"> 

我要補充@user.Receipt_No裏面作爲其價值。值從DB.Please的用戶表中讀取幫我解決這個問題。

回答

1

試試這個,

<input type="text" class="form-control" placeholder="Receipt No" value="<%= @user.Receipt_No %>"> 
相關問題