|
2 | 2 |
|
3 | 3 | <img src="https://s3.amazonaws.com/learn-verified/puppies.gif" hspace="10" align="right" width="300"> |
4 | 4 |
|
5 | | -Your local pet adoption store has asked you (a frequent dog walker and vistor) to build their new site because their old one was built in WordPress and sucks. Good thing you love puppies and coding! |
| 5 | +Your local pet adoption store has asked you (a frequent dog walker and visitor) to build their new site because their old one was built in WordPress and sucks. Good thing you love puppies and coding! |
6 | 6 |
|
7 | 7 | ## Objectives |
8 | 8 |
|
9 | 9 | 1. Implement a POST request to the controller to display data from a user in the view |
10 | 10 | 2. Implement both POST and GET requests |
11 | 11 | 3. Connect a controller action with both a view and a model |
12 | 12 |
|
13 | | -## Get Building |
| 13 | +## Instructions |
14 | 14 |
|
15 | | -### Step 1: |
16 | | -Build out a puppy class in `models/puppy.rb`. Puppies should have name, breed, and age attributes. You will need to be able to pass these 3 attributes to initialization, as well as readers and writers for the attributes. |
| 15 | +1. Build out a puppy class in `models/puppy.rb`. Puppies should have name, breed, and age attributes. You will need to be able to pass these three attributes to initialization, as well as readers and writers for the attributes. |
17 | 16 |
|
18 | | -### Step 2: |
| 17 | +2. In `app.rb` build out a GET request to load a home page. The home page should go to the main route `/`. |
19 | 18 |
|
20 | | -In `app.rb` build out a GET request to load a home page. The home page should go to the main route `/`. |
| 19 | +3. The home page will also need a new view `index.erb`. This page should welcome you to the Puppy Adoption Site. Add this view to the controller action. |
21 | 20 |
|
| 21 | +4. Now, we need to create a form for a user to list a new puppy that is available for adoption. You can create this form in `views/create_puppy.erb`. Remember, you'll need to set up another controller action for a user to be able to view this form in the browser. |
22 | 22 |
|
23 | | -### Step 3: |
24 | | -The home page will also need a new view `index.erb`. This page should welcome you to the Puppy Adoption Site. Add this view to the controller action. |
| 23 | +5. Now we need to make sure the form is being submitted properly. You'll need to have a third controller action that takes the input from the user and renders a third view (`views/dislay_puppy.erb`) which displays the info for the puppy that was just created. |
25 | 24 |
|
26 | | - |
27 | | -### Step 4: |
28 | | -Now, we need to create a form for a user to list a new puppy that is available for adoption. You can create this form in `views/create_puppy.erb`. Remember, you'll need to set up another controller action for a user to be able to view this form in the browser. |
29 | | - |
30 | | -### Step 5: |
31 | | - |
32 | | -Now we need to make sure the form is being submitted properly. You'll need to have a third controller action that takes the input from the user and renders a third view (`views/dislay_puppy.erb`) which displays the info for the puppy that was just created. |
33 | | - |
34 | | -### Step 6: |
35 | | - |
36 | | -Add a link to the homepage to link to the new puppy form. |
| 25 | +6. Add a link to the homepage to link to the new puppy form. |
37 | 26 |
|
38 | 27 |
|
39 | 28 |
|
|
0 commit comments