Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you want to do the form vanilla (as in, without simpleform-bootstrap or other gems), you need to shape the form HTML accordingly:</p> <pre><code>&lt;div class="row-fluid"&gt; &lt;div class="span4 well"&gt; &lt;%= form_for @member, :html =&gt; {:class =&gt; "form-horizontal"} do |m| %&gt; &lt;fieldset&gt; &lt;legend&gt;Member Form&lt;/legend&gt; &lt;div class="control-group"&gt; &lt;%= m.label :title, :class =&gt; "control-label" %&gt; &lt;div class="controls"&gt; &lt;%= m.text_field :title, :class =&gt; "input-xlarge" %&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-actions"&gt; &lt;%= m.submit :class =&gt; "btn btn-primary" %&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;% end %&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>As Arun Kumar Arjunan says, the form builder is not generating the html needed for the bootstrap framework.</p> <p>Definitely check out the HTML needed in the <a href="http://twitter.github.com/bootstrap/base-css.html#forms" rel="nofollow">bootstrap example pages</a>, and/or by inspecting the DOM (i found that it's not really well documented). All in all, you can do it manually, like above, by creating your own <a href="http://railscasts.com/episodes/311-form-builders" rel="nofollow">form builder</a>, or by using various gems.</p> <p>Also as a sidenote, make sure to check out <a href="http://guides.rubyonrails.org/active_record_validations_callbacks.html#customizing-error-messages-css" rel="nofollow">how to customize the errors css</a>, because by default, when a validation error occurs, the field is wrapped by a <code>&lt;div class ="field_with_errors"&gt;</code> breaking the css selectors used by bootstrap.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload