O'Reilly logo

Bootstrap for Rails by Syed Fazle Rahman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Bootstrap forms

Creating forms in Bootstrap is as easy as creating tables, which we have just seen in the previous section. All you need is some HTML markup and proper Bootstrap classes for forms. In this section, we will again create a dummy project called Bootstrap Forms and add an index.html file. Also, fill this file with the basic Bootstrap recommended HTML, as shown in the previous section. Do not forget to add the Bootstrap container in it.

Let's add a simple <form> tag to the preceding container:

<div class="container">
  <form>            
  </form>
</div>

You don't have to attach any class to the form tag. The classes here are added to the form elements.

Let's add our first form element to our form. We will place a text field and an associated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required