Hello,
I've created:
PhotoAlbum (id, name)
has_many: photos
Photo (id, name, photo_album_id)
belongs_to: photo_album
I want to allow a user to upload 1 or more photos. Per Upload whether it be 1 or more photos, they should automatically be added to a new album.
So the way i have it is, a user clicks upload photos: They get the photo view where they get the form. They can then upload 1 photo (in the future I want to support more than 1, but baby steps!
so now in my Photos Controller, I have DEF CREATE
Q: How in the DEF CREATE, do I auto create an album and then create the photos? Something like?
@photo_album = PhotoAlbum.create
@photo = @photo_album.create(params[:photo])
? Is this the right Rails way to do this?
Thanks