Update: I updated this after doing some operations and realized that it could be a twitter-bootstrap problem causing the problem.
Here is a rough version of my nested form:
<%= 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 %>
When rendering, the fields in the rows of the indented table are similar to the parent forms using { :class => 'form-horizontal' }
. I just want fields without div separators, etc. And, it seems, they could not understand. I thought :wrapper => false
was a ticket, but so far no luck.
Dan
source share