我正在尝试使用twitter bootstrap创建内联表单。当我执行以下操作时,文本字段都是内联的,但下拉按钮不是。相反,下拉按钮与屏幕一样宽。我怎样才能使它内联?
<%= form_for @project, {:class => "form-inline"} do |f| %>
<%= render 'shared/error_messages', :object => f.object %>
<%= f.text_field :a, :class=> "input-small", :placeholder=>"a" %>
<%= f.text_field :b, :class=> "input-small", :placeholder=>"b" %>
<%= f.text_field :c, :class=> "input-small", :placeholder=>"c" %>
<%= f.text_field :d, :class=> "input-small", :placeholder=>"d" %>
<%= f.text_field :e, :class=> "input-small", :placeholder=>"e" %>
<%= f.label :one_two %>
<%= f.select :one_two, options_for_select([['One','One'],['Two',Two]]) %>
<%= f.submit "Submit", :class => "btn" %>
<% end %>
</div>
</div>
答案 0 :(得分:1)
也许你可以尝试以下方法来包装select标签。
<div class="control-group">
<label class="control-label"><%= f.label :one_two %></label>
<div class="controls">
<%= f.select :one_two, options_for_select([['One','One'],['Two',Two]]) %>
</div>
</div>