This is my code:
Expand|Select|Wrap|Line Numbers
- //user model
- belongs_to season
- belongs_to album
- has_many albums
- #### ----->
- def get_pic
- @pic = Picture.where(:album_id => 'Album.album_id' ,
- user.where(:culture_id => 'Culture.culture_id')).first
- end
- ### ----->
- // Picture model//
- belongs_to season
- belongs_to album
- //Culture model//
- has_many pictures
- has_one
- // album model//
- has_many pictures
- has_many pictures through => 2011year
- has_many pictures through => 2010year
- has_many pictures through => 2009year
- //2011yea model //
- belongs_to picture
- //2010yea model //
- belongs_to picture
- //2009yea model //
- belongs_to picture
Expand|Select|Wrap|Line Numbers
- picture_id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
- album_id integer NOT NULL,
- culture_id integer NOT NULL,
- image binary
- my user controller is
- def show
- @user= User.all
- @my= User.get_pic
- end
in Picture table.
Plus, i have caused a problem on this code as well
@pic = Picture.where(:album_id => 'Album.album_id' ,
user.where(:culture_id => 'Culture.culture_id')).first
it causes a syntax error
Please help . please help ... thanks thanks
Thanks