Search code examples
ruby-on-railstwitter-bootstrapcheckboxtwitter-bootstrap-3formtastic

Checkboxes in formtastic bootstrap


Recently, I installed the formtastic-bootstrap gem on my ruby-on-rails application. I have the following code on one of my forms that includes check-boxes:

<% if @gallery.tag_list.empty? %>
    <%= f.input :tag_list, :as => :check_boxes, :label => _('Select Applicable Tags'), :collection => Gallery::DEFAULT_TAGS.sort, :wrapper_html => {:class => 'horizontal_list'} %>
<% else %>
    <%= f.input :tag_list, :as => :check_boxes, :label => _('Current Tags'), :collection => @gallery.tag_list.sort, :wrapper_html => {:class => 'horizontal_list'} %>           
<% end -%>

Even though formtastic-bootstrap is rendering the rest of my form correctly, my checkboxes are not showing up. The text next to the check-boxes appears, but the checkboxed themselves do not. Any suggestions to get this working are welcome. I have been trying to circumvent this little, annoying issue all day.


Solution

  • I had to create a bootstrapcustom.css.scss to over-ride the bootstrap properties of padding and margins on check-box elements in order to make them appear in the end.