我有一個軌道應用程序,我希望窗體字段並排而不是下面。我能做的最好的是使用form-inline並排獲取它們,但標籤會與左側對齊。標籤應該在頂部。我也想知道如何將表單域的大小保持爲一半。我的代碼是:在軌道中使用引導程序並排設置窗體字段
<div class="container">
<%= form_for '#' do |f|%>
<div class= "hero-unit">
<%=f.label "First Name"%>
<%=f.text_field '#', :class=>"span5" %>
<%=f.label "Last Name" %>
<%=f.text_field '#', :class=>"span5" %>
</div>
<% end %>
</div>
,這導致:但我需要的是:
請幫助。
這不是我想要的。我希望文本字段位於標籤下方,另一個標籤和文本字段位於右側。你可以在圖像中看到它。 – sushilthe
查看已更新的答案。 – ajkumar25