我在 rails 4 中使用 simple_form 和 bootstrap。我希望开始日期和开始时间在同一行,结束日期和结束时间在同一行。我已经尝试过类似问题的解决方案,但没有一个有效。我是rails的新手。请帮我。
这是我的代码:
<%= b.input :start_date, wrapper: :horizontal_input_group do %>
<%= b.input_field :start_date, class: "form-control date start" %>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
<% end %>
<%= b.input :start_time, wrapper: :horizontal_input_group do %>
<%= b.input_field :start_time, as: :string, class: "form-control time start" %>
<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
<% end %>
<%= b.input :end_date, wrapper: :horizontal_input_group do %>
<%= b.input_field :end_date, class: "form-control date end" %>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
<% end %>
<%= b.input :end_time, wrapper: :horizontal_input_group do %>
<%= b.input_field :end_time, as: :string, class: "form-control time end" %>
<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
<% end %>
<% end %>