我在 app/admin/products.rb 中有这段代码。我有一个问题,我一次只能看到一个输入字段(列出的最后一个)或只是提交按钮。可能是因为一些语法错误吗?但是没有任何错误信息。
ActiveAdmin.register Product do
f.input :name,:label => "Name"
f.input :photo, :as => :file
f.input :category, :collection => @category
f.input :manufacturer, :collection => @manufacturer
f.actions do
f.action :submit, :button_html => { :class => "primary", :disable_with => 'Wait...' }
end
end
end
产品型号是这样的
attr_accessible :category_id, :description, :manufacturer_id, :name, :photo
extend FriendlyId
has_attached_file :photo,
:styles => {
:thumb=> "100x100#",
:large => "290x170",
:medium=> "120x120"}
friendly_id :name, use: [:slugged, :history]
belongs_to :manufacturer
belongs_to :category