Rails form_tag Lab
Objectives
Build a functional Rails form using a
form_tagPass a route helper as the argument to a
form_tagPass an options hash with a method to a
form_tagUse a
text_field_tagand other form controls to create inputsBuild a
newaction that renders a form that submits to thecreateaction
Instructions
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, have the form redirect back to the new view template (commonly, a create action would redirect to index), and print out the form params to the screen. Below are a few items to keep in mind:
Draw a
newandcreateroute for thestudentsresourcePrint out the student value to the view template page
Keys to remember
Look at the tests to see which field values you should be using
Make sure to use the
form_taghelpers
Resources
Clone : https://github.com/learn-co-curriculum/rails-form_tag-lab
Last updated