Created
April 28, 2019 02:26
-
-
Save harrisonmalone/be85b8f4a2d33d52d0f667e971eb5be0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implement image uploads to a project you've already started on | |
for example, add an image upload field when you create a restaurant | |
optional | |
create a photos.google.com clone 📸 | |
start with this structure for your models | |
- album model: name:string | |
- photos model: album:references | |
relationships | |
- an album has many photos | |
- a photo belongs to an album | |
- a photo has_one_attached :uploaded_image | |
advanced | |
- allow for users to upload many photos at once to an album | |
- allow for photos to belong to many albums therefore we have new relationships | |
relationships #2 | |
- a photo has many albums | |
- an album has many photos | |
you will need a join table to get the job done 🤝 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment