Bootcamp
Search…
3.POCE.7: Bird Watching Species

Introduction

Add species classifications to the bird watching app.

Base

Refactor the Bird Watcher app so that when a user creates a note they can select from a list which species of bird they have observed. You will need material from 3.5.5: Rendering One-To-Many Forms to do this.

Species Table

column name
data type
description
example
id
SERIAL PRIMARY KEY
ID
1
name
TEXT
Name of species
Northern Pintail
scientific_name
TEXT
Scientific name of species
Anas acuta

Species Seed Data

Here are some species we can add to the DB to start.

Comfortable

Create CRUD routes for maintaining species data in the Bird Watcher app.

Routes

URL Path
Method
Purpose
/species
GET
Render a form that will create a new species
/species
POST
Accept a POST request to create a new species
/species/:index
GET
Render a single species. This has a list of all notes with this species.
/species/all
GET
Render a list of species in addition to the previous data rendered on the root route.
/species/:index/edit
GET
Render a form to edit a species
/species/:index/edit
PUT
Accept a request to edit a single species
/species/:index/delete
DELETE
Accept a request to delete a species

Reference solution

Click here to see the reference solution for this post class.