Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Modeling the Image Gallery0:51 with Jason Seifer
Now that we have image uploads and resizing working, we can implement an image gallery and albums to Treebook. Since we already have a model for storing our images, we really only need to classify these into albums. In Rails terms, we’ll create an album model which has_many associated images. We’ll start out by creating an album model and then add the code and associations for images.
[Advanced Social Features in Ruby in Rails: Stage 3: Create an Image Gallery]
Now that we have image uploads and resizing working,
we can implement an image gallery and albums
to our social networking application.
We'll use some of the concepts from the previous stage
as well as our knowledge of associations
in order to accomplish this task.
Since we already have a model for storing our images,
we really only need to classify these into albums.
By thinking of it this way, we can have an album
being composed of a lot of different images,
In Rails' terms, we'll create an album model
which has many associated images.
We'll start out by creating the Album model
and then add the code for associations for images.
You need to sign up for Treehouse in order to download course files.Sign up