- Build a functional Rails form using a
form_tag
- Pass a route helper as the argument to a
form_tag
- Pass an options hash with a method to a
form_tag
- Use a
text_field_tag
and other form controls to create inputs - Build a
new
action that renders a form that submits to thecreate
action
The two specs for this lab that are currently failing are located within the
form page
feature in specs/features/student_spec.rb
.
For this lab, you need to build a form to create a new student, create a new
student using params
in the create
route, and redirect to the index
route
to display all the students. Below are a few items to keep in mind:
- Draw a
new
andcreate
route for thestudents
resource - Create a student using the data from the form via
params
. If you're not sure how the params are being sent from the form, usebyebug
in your route orputs
to display the params in the terminal. - Redirect to the
index
route where all students will be displayed
-
Look at the tests to see which field values you should be using
-
Make sure to use the
form_tag
helpers