i have database for dynamic website in which i need to store
information about each menu and its relationship with other menu.
it is obvious that each menu can have several submenu but each submenu
must belong to one and ony one menu.
so database goes like this
title =>integer, it is name of menu
Image_path=>string, path of image
Content_text=> text contained on click of every menu or description
fK_parent_content_id => integer , THIS LINKS BACK TO pk_content_id ,as
is a foreign key
what i want is to relate pk_content_id and fk_parent_content_id (which
are in same table)
how to accomplish such self refrencing many to one relation???
m extreme beginner in rails please be more descriptive.
just to mention pk- represents primary key so is unique while fk is
foreign key and is not unique, combinaly forms one to many relation
thanks in advance