开发者

form select is not remembering value

Select helper is not remembering its database value. But Text field is remembering. Any ideas? Thanks.

<%= form_for([:admin, @produ开发者_C百科ct], :remote => true ) do |f| %>      
<%= f.text_field :name %>
<%= f.select(:search_status, ["0","1","2"]) %>
<% end %>


It's likely that search_status is an integer and not matching the strings in your array. Does it work if you use [0,1,2] instead?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜