Generating Forms
HTML provides a number of elements, attributes, and attribute values that control how input is gathered. You certainly could hand-code your form directly into the template, but there’s no need to.
In this section, we’ll cover a number of helpers that Rails provides that assist with this process. In Using Helpers, we’ll show you how you can create your own helpers.
HTML provides a number of ways to collect data in forms. A few of the more common means are shown in the following screenshot. Note that the form itself isn’t representative of any sort of typical use; in general, you’ll use only a subset of these methods to collect data.
Let’s look at the template that was used to produce that form:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access