Форматирование вложенной таблицы с помощью simple_form, nested_form и twitter-bootstrap

Обновление:Я обновил это после того, как немного покопался и понял, что это может быть twitter-bootstrap, вызывающий проблему.

Вот грубая версия моей вложенной формы:

<%= simple_nested_form_for @user, :html => { :class => 'form-horizontal' } do |f| %>
  <fieldset>
    <%= f.input :email %>
    <%= f.input :name_first %>
    <%= f.input :name_last %>

            <table class="table table-striped">
              <thead>
                <tr>
                  <th>Active</th>
                  <th>Company</th>
                  <th>Role</th>
                  <th>Actions</th>
                </tr>
              </thead>
              <tbody>
                  <%= f.simple_fields_for :roles, :wrapper_tag => :tr do |role_form| %>
                    <td><%= role_form.hidden_field :id %><%= role_form.input :active, :label => false, :wrapper => false %></td>
                    <td><%= role_form.association :company, :label => false, :wrapper => false %></td>
                    <td><%= role_form.input :role, :label => false, :collection => [ "Guest", "User", "Inspector", "Owner"], :wrapper => false %></td>
                    <td><%= role_form.link_to_remove "Delete", :class => 'btn btn-mini btn-danger' %>
                    </td>
                  <% end %> 
              </tbody>
            </table>
               <p><%= f.link_to_add "Add a Role", :roles %></p>
        </div>

    <div class="form-actions">
      <%= f.submit nil, :class => 'btn btn-primary' %>
      <%= link_to 'Cancel', users_path, :class => 'btn' %>
    </div>
  </fieldset>
<% end %>

При рендеринге поля в строках таблицы имеют такой же отступ, как и в родительской форме, через { :class => 'form-horizontal' }. Мне просто нужны поля без разделителей-оболочек и т. Д., И я не могу понять это. Я думал, что :wrapper => falseбыл билетом, но пока не повезло.

Дэн

6
задан Dan Tappin 20 March 2012 в 19:07
поделиться