Skip to Content
Learn Rails 5.2: Accelerated Web Development with Ruby on Rails
book

Learn Rails 5.2: Accelerated Web Development with Ruby on Rails

by Stefan Wintermeyer
April 2018
Beginner to intermediate
444 pages
7h 35m
English
Apress
Content preview from Learn Rails 5.2: Accelerated Web Development with Ruby on Rails
© Stefan Wintermeyer 2018
Stefan WintermeyerLearn Rails 5.2https://doi.org/10.1007/978-1-4842-3489-1_7

7. Forms

Stefan Wintermeyer1 
(1)
Bochum, Germany
 

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 ...
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.
Start your free trial

You might also like

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Adam Notodikromo
Agile Web Development with Rails 5.1

Agile Web Development with Rails 5.1

Sam Ruby, David B. Copeland, Dave Thomas
Rails 4 in Action

Rails 4 in Action

Yehuda Katz, Rebecca Skinner, Stephen Klabnik, Ryan Bigg

Publisher Resources

ISBN: 9781484234891Purchase LinkPublisher Website