当前位置 : 主页 > 编程语言 > ruby >

ruby-on-rails – Rails ActiveAdmin,表单页面上的两列(不是侧边栏)

来源:互联网 收集:自由互联 发布时间:2021-06-23
在活动管理员的表单中,字段根据窗口的大小在页面上水平扩展.如果它是一个大显示器,右边有很多“未使用”的空间. 如何在页面右侧添加“列”(不是侧栏),这样我最终会在左侧的表格
在活动管理员的表单中,字段根据窗口的大小在页面上水平扩展.如果它是一个大显示器,右边有很多“未使用”的空间.

如何在页面右侧添加“列”(不是侧栏),这样我最终会在左侧的表格中放置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类,然后你可以修改active_admin.css.scss(或只是.css),这样它会将你的表单浮动到正确的位置,并给它们一个正确的宽度等
网友评论