In this chapter, I’ll talk about forms.
The Data-Input Workflow
To understand forms, you need take a look at the data workflow. Understanding it better will help you to understand how forms work.
Here is an example application:
$ rails new testapp
$ cd testapp
$ rails generate scaffold Person first_name last_name
$ rails db:migrate
$ rails server
Usually you will create forms by using the scaffold. Let’s go through the flow the data.
Request the people#new Form
When you request the http://localhost:3000/people/new URL, the router answers with the following route:
new_person GET /people/new(.:format) people#new ...