微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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),这样它会将你的表单浮动到正确的位置,并给它们一个正确的宽度等

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐