Ruby on rails 简单表单文本框非常长

Ruby on rails 简单表单文本框非常长,ruby-on-rails,devise,simple-form,Ruby On Rails,Devise,Simple Form,使用simple_form和bootstrap时,我很难将输入框设置为正确的大小。它们不同,太长,太长。我可以在CSS中硬编码它们,但是它们没有响应性。我尝试了“最大宽度”,但结果是固定宽度。还使用Desive gem进行用户身份验证 页面代码: <div class="booyah-box col-xs-10 col-xs-offset-1"> <h2>Sign up</h2> <%= simple_form_for(resource, as: re

使用simple_form和bootstrap时,我很难将输入框设置为正确的大小。它们不同,太长,太长。我可以在CSS中硬编码它们,但是它们没有响应性。我尝试了“最大宽度”,但结果是固定宽度。还使用Desive gem进行用户身份验证

页面代码:

<div class="booyah-box col-xs-10 col-xs-offset-1">
<h2>Sign up</h2>

<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
  <%= f.error_notification %>

  <div class="form-inputs">
    <%= f.input :email, required: true, autofocus: true %>
    <%= f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @validatable) %>
    <%= f.input :password_confirmation, required: true %>
  </div>

  <div class="form-actions">
    <%= f.button :submit, "Sign in", :class => 'btn btn-primary' %>
  </div>
<% end %>

<%= render "devise/shared/links" %>
</div>

请将代码粘贴到这里。您可能需要使用谷歌Chrome的开发工具来查看文本框应用了什么CSS规则。看起来你的CSS在什么地方坏了。上面粘贴了代码。目前,在这些输入上,除了标准引导/simple_表单之外,没有特定的CSS。我遇到了一个问题,在添加simple_form gem之前我已经生成了设计视图,因此我不得不在添加simple_form gem之后返回并重新生成设计视图。对不起,事实并非如此。下面是代码所在的booyah box类的CSS:。booyah box{-moz box shadow:1px 1px 2px 0 d0d0;-webkit box shadow:1px 1px 2px 0 d0d0;box shadow:1px 1px 2px 0 d0d0;背景:fff;边框:1px实心ccc;边框颜色:e4e4e4e4bebebd bebd e4e4e4e4e4;填充:10px;}。booyah box h2,.booyah box h1{margin:10px;}谢谢Emu。服务器重启解决了这些问题。
<div class="row">
<h2>Sign up</h2>
<div class="col-lg-8 col-md-4 col-sm-12 col-xs-12">
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
  <%= f.error_notification %>

  <div class="form-group">
    <%= f.input :email, required: true, autofocus: true, class: "form-control" %>

   // you can add class **col-lg-6** in any input field for maintaining the width

    <%= f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @validatable), class: "form-control" %>
    <%= f.input :password_confirmation, required: true, class: "form-control" %>
  </div>

  <div class="form-group">
    <%= f.button :submit, "Sign in", :class => 'btn btn-primary' %>
  </div>
<% end %>

<%= render "devise/shared/links" %>
</div>
</div>