From the course: Ruby on Rails 5 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Form basics

Form basics - Ruby on Rails Tutorial

From the course: Ruby on Rails 5 Essential Training

Start my 1-month free trial

Form basics

- [Teacher] Before we can add the create, update, and delete action in our controllers we need to learn about using forms in Ruby on Rails. We'll introduce the basics of forms now, and then take a deeper dive later. There are a couple of points that I want you to remember about working with Rails helpers to generate HTML for our forms. The first is that anything that we can write with the helpers can also be written using simple HTML. That's all the helpers are doing, they're helping us write HTML and the end result that gets sent back to the browser is always just going to be plain HTML. The second point is that writing code using these helpers is almost always easier, more powerful, and includes lots of extra benefits than if we use simple HTML alone and we'll see some of those as we go along. Let's first begin by looking at a standard HTML form. Again this not Ruby on Rails, this is just basic HTML. Notice that my form has three text input fields for name, position, and visible…

Contents