ruby-on-rails – 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,:select => "city").map(&:city)
    f.input :place_of_delivery,:select => "city").map(&:city)
    f.input :via,:select => "city").map(&:city)
  end
  f.inputs "Carrier" do
    f.input :carrier,:label_method => :company_name
    f.input :mode,: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),这样它会将你的表单浮动到正确的位置,并给它们一个正确的宽度等

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...