1
我有这个代码里面的应用程序/管理/ 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
感谢,这是工作:) – Edgars