Superheroes!
Description
In this lab, you'll practice building nested forms in Sinatra for creating teams of superheros. No database is required, but feel free to add persistence after you have successfully completed the instructions below.
Instructions
bundle install
bundle exec shotgun
Make a form
- Create a route that responds to a GET request at
/
. - Create a view with a form and render it in the GET
/
route. - The form should have fields for the
name
of a superhero team and theirmotto
. - There should be form inputs for each of the three superhero member's
name
,power
, andbio
.
It should look something like this:
Handle form submission
- Create a route that responds to a POST request at
/teams
- Have the form send a POST request to this route.
- Upon submission, render a template that displays the submitted team data and each member's data.
Final Output
Your params should be nested. For example, you would access the first super-hero's name as:
params["team"]["members"][0][name]
When you post to this form you should render a page that displays the name of the team and each member of the team, along with their name, super power and bio.
Your view should display something like this:
Deliverables
Pass the tests!