3
在活动管理员的表单中,根据窗口的大小,字段在页面内水平扩展。如果它是一个大显示器,右边有很多“未使用”的空间。Rails ActiveAdmin,表单页面上的两列(不是侧栏)
如何在页面的右侧添加一个“列”(不是侧栏),以便最终在左侧的窗体的50%宽度部分和50%宽度的部分形式在右边?
我需要这个,因为我有很多字段。
这是我的形式部分看起来像现在...
form do |f|
f.inputs "Shipment Details" do
f.input :file_number
f.input :customer, :label_method => :company_name
f.input :shipper, :label_method => :company_name
f.input :broker, :label_method => :company_name
end
f.inputs "Places" do
f.input :place_of_origin, :as => :select, :collection => Place.find(:all, :order => "city", :select => "city").map(&:city)
f.input :place_of_loading, :as => :select, :collection => Place.find(:all, :order => "city", :select => "city").map(&:city)
f.input :place_of_delivery, :as => :select, :collection => Place.find(:all, :order => "city", :select => "city").map(&:city)
f.input :via, :as => :select, :collection => Place.find(:all, :order => "city", :select => "city").map(&:city)
end
f.inputs "Carrier" do
f.input :carrier, :label_method => :company_name
f.input :mode, :as => :select,
:collection => ["Air", "Air Collect", "Air Prepaid", "FCL", "FTL", "LCL", "LTL", "TBA"]
f.input :mbl, :label => "MBL"
f.input :hbl, :label => "HQL"
f.input :vessel
f.input :container
end
f.buttons
end
正确,如果你正在寻找简单的风格的内容不同,你会用CSS来做到这一点。 – andrewpthorp 2011-12-22 22:01:59
酷,我试图看看是否有办法通过使用现有的activeadmin CSS,但如果没有,那么我会按照你的建议。将尝试一下。 – leonel 2011-12-22 22:16:36
请记住,如果您使用多个activeadmin命名空间,并且只希望此CSS影响“我的”命名空间,则应将所有activeadmin CSS都放在“body.active_admin”(或“body.active_admin.my_namespace”)范围内。 – 2013-11-19 20:27:27