【发布时间】:2011-12-20 18:52:46
【问题描述】:
我目前安装了 active_admin(也使用了 formtastic),当然也安装了 formtastic 本身。
请看下面的代码:
<%= f.inputs :hero_id, :as => :select, :collection => Hero.find(:all) %>
<%= f.inputs :name %>
<%= f.inputs :starting_items, :as => :select, :collection => Item.find(:all) %>
<%= f.inputs :early_items, :as => :select, :collection => Item.find(:all) %>
<%= f.inputs :core_items, :as => :select, :collection => Item.find(:all) %>
<%= f.inputs :situational_items, :as => :select, :collection => Item.find(:all) %>
<%= f.buttons %>
这个完全相同的代码在 active_admin 中显示填充了数据的选择框。
但是,在我的网站本身上,它只会显示 text_fields,没有任何选择框!
有人知道这里可能是什么问题吗? 因为我的网站上有其他几种表格,如果我能让它正常工作,我可以修复。所有的表单都只是显示 text_fields 而不是选择框、单选按钮、复选框等。
【问题讨论】: