【发布时间】:2011-12-22 21:43:28
【问题描述】:
在活动管理中的表单中,字段根据窗口的大小在页面上水平扩展。如果是大显示器,右边有很多“未使用”的空间。
如何在页面右侧添加一个“列”(不是侧边栏),以便最终在左侧获得 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
【问题讨论】:
标签: ruby-on-rails ruby forms activeadmin