Note: This guide will focus on forms; you can learn more about requests in Lecture Guide 1! Finally, In-Memory Models was never covered in class for it is just an extension of basic Ruby concepts. This guide adds some supplementary resources to help you get familiar with them 🙂
In Lecture Guide 2, we introduced the idea of templating: view files (specifically *.html.erb
) that have embedded ruby to calculate values before sending it back to the browser. As a quick refresher, what this looks like is below:
<h1> <%= @name %> </h1>
The embedded ruby above will evaluate what @name
is before it's inserted into the html. We're expected to set @name
in the controller action that's linked to this template.
Today, we approach the question of how we can create a more interactive UI. Specifically, how do we include forms that the user can fill out? First, let's see what this looks like on the screen: