在阅读了建议我使用Simple_form gem和bootstrap集成的答案之后,我安装了它并根据simple_form指令创建了我的表单,但输入框是右对齐的。将Twitter引导样式添加到Rails表单助手
这是布局。窗体被称为与局部的共享/ REG'
<div class="container">
<div class="row">
<div class="span8"><%= yield %></div>
<div class="span4">
<%= render 'shared/reg' %>
</div>
</div>
</div>
这是我简单的表格形式
<%= simple_form_for("user", :url => main_app.user_registration_path, :html => { :class => "form-horizontal" }) do |f| %>
<%= f.input :name %>
<%= f.input :vote, :collection => [ "For", "Against", "Undecided"] %>
<%= f.input :country, :collection => [ "Canada", "Iceland", "Other"] %>
<%= f.input :email %>
<%= f.input :image, :as => :file %>
<%= f.input :password %>
<%= f.input :password_confirmation %>
<%= f.button :submit %>
<% end %>
下面你可以看到输入框相权浮出提交按钮。
更新
you're missing