I have a bunch of scores that I want to render horizontally using form-inline (twitter bootstrap). If they are specified separately, they work fine, but if specified using: by default, the class is not displayed.
%ul.nav.nav-tabs
%li= link_to "General", "#client_tab1", 'data-toggle'=>"tab"
%li= link_to "Applications", "#client_tab2", 'data-toggle'=>"tab"
= simple_form_for @client, defaults:{input_html:{class:'form-inline'}}, :html=>{:class=>"client tab-content"} do |f|
= render :partial => "client", :locals => {:f => f}
= render :partial => "applications/applications", :locals => {:f => f}
.actions
= f.button :submit, class:"btn-primary", value: "Save"
and partial looks something like this:
.status
.span3
= f.label :status
= f.collection_select :status_id, selection_list(Status), :last, :first
%br
= f.input :open_date, :as => :jdate
%br
= f.label :assigned_to
= f.collection_select :assigned_to_id, selection_list(User), :last, :first
%br
.form-inline
= f.label :assistant
= f.collection_select :assistant_id, selection_list(User), :last, :first
%br
In the above example with an explicit .form-inline, everything works as expected. But according to the sample code below https://github.com/plataformatec/simple_form the classes defined in: defaults should apply to all methods. This is actually not the case.
<%= simple_form_for @user, :defaults => { :input_html => { :class => 'default_class' } } do |f| %>
<%= f.input :username, :input_html => { :class => 'special' } %>
<%= f.input :password, :input_html => { :maxlength => 20 } %>
<%= f.input :remember_me, :input_html => { :value => '1' } %>
<%= f.button :submit %>
<% end %>
Can someone explain why this could be or what I am doing wrong?