views:

14

answers:

1

Hello, I'm looking for suggestions on creating a model/scaffold for Photos

I want a user to be able to create a album that contains 1 or more photos.

Current idea:

album
id, name, user_id

photos
id, name, album_id

Thoughts?

Thanks

A: 

The above works fine if you want to constrain each photo to only one album. If a photo can belong to multiple albums you'll have to look into the has_many :through relationship.

Rails Associations

sosborn
Cool, a photo only needs to belong to one album. Propably shouldenforce that too
AnApprentice