Prepared the data required to paint the list of all pictures.
Formatted the data for human consumption in the view template.
One down, six to go! Next up: made a route to support displaying the details of one picture.
Defined a method to handle the details of one picture request.
Created a template to format the details of one picture.
Prepared the data required to paint the details of one picture.
Formatted the data for human consumption in the view template.
Next up: the user should be able to request a form to enter information for a new picture.
Defined a method to handle the form for a new picture request.
Created a template to paint a form for a new picture.
We don't need any data from the database to draw a form for a new picture, so we can leave the new method empty and simply write the HTML for a form in the view template. When the user clicks Create Picture, we choose to send the form data to http://localhost:3000/pictures with a POST by setting the arguments of form_tag accordingly.
Next up: when the user clicks Create Picture, we need to receive the information from the form and create a new row in the database.