当转到表单的编辑视图时,将值先前发布到数据库中,除下拉菜单字段外,所有字段都将重新填充。例如,“惊讶”值现在在数据库中。当我打开编辑页面时,我只看到默认的“选择选项...”
这是我的表格中的内容:
<%= f.select :emotion, options_for_select([["Happy", "Happy"], ["Afraid", "Afraid"], ["Sad", "Sad"], ["Surprised", "Surprised"], ["Inspired", "Inspired"]]), :include_blank => 'Select Option...' %>
如何让它重新填充?