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?
精彩评论