2

我正在尝试以一般水平的形式创建 2 个内联字段(最小年龄和最大年龄字段),但没有任何效果。

=simple_form_for([:admin, @group], :html => {:class => 'form-horizontal', :remote => true },  wrapper: :horizontal_form, wrapper_mappings: {check_boxes: :horizontal_radio_and_checkboxes, radio_buttons: :horizontal_radio_and_checkboxes, file: :horizontal_file_input, boolean: :horizontal_boolean}, ) do |f|
  =f.input :title
  =f.input :desc, :label => "Description"
  =f.input :minimum_age,:wrapper_html => { :style => 'display: inline !important' }
  =f.input :maximum_age, :wrapper_html => { :style => 'display: inline !important' }
  =f.input :include_null_birthday, as: :radio_buttons, label_html: {data: {toggle: "tooltip", title: "Some comment.", placement: "right"}}, label: "Include people with no birthday set [?]"

有谁知道如何做到这一点?

4

1 回答 1

0

这有点晚了,但因为这很容易:

    <div class="button-inline">
      <%= f.input :minimum_age,:wrapper_html %>
      <%= f.input :maximum_age, :wrapper_html %>
    </div>

在你的 CSS 中:

    .button-inline {
      display: flex;
      justify-content: space-between;
    }
于 2016-07-20T20:53:39.170 回答