开发者

form select is not remembering value

开发者 https://www.devze.com 2023-03-19 09:02 出处:网络
Select helper is not remembering its database value. But Text field is remembering. Any ideas? Thanks.

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

精彩评论

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