Generating Forms
Get familiar with the HTML forms using templates
We'll cover the following...
Gathering information using HTML form
HTML provides a number of elements, attributes, and attribute values that control how input is gathered. We could certainly hand-code our form directly into the template, but there is no need to do that.
In this chapter, we will cover a number of helpers that Rails provides to assist with this process.
HTML provides a number of ways to collect data in forms. A few of the more common means are shown below. Note that the form itself is not representative of any sort of typical use; in general, we’ll use only a subset of these methods to collect data.
Let’s look at the template that was used to produce that form:
In the above template, we’ll see a number of labels, like the one in line 3. We use labels to associate text with an input field ...