Bootstrap logo

Bootstrap Horizontal Form With Simple Form

Posted by Weston Ganger on March 18, 2015

I had endless issues trying to get horizontal-form in bootstrap 3 to play nice with simple_form. It doesnt really seem like there is an easy way.

Enter simple_form_bootstrap3. You get alternative methods to use so instead of simple_form_for you can use horizontal_form_for

<%= horizontal_form_for @post do |f| %>
  <%= f.input :name %>
<% end %>

You will have problems if you want to have horizontal and inline fields in the same form, in that case use compact_form_for and add the labels and columns manually

If anyone has a better solution or one that works easily in the regular simple_form gem I would love to hear about it

Posted in Rails and Tagged with simple_form bootstrap rails horizontal-form 

Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts