Forum: Ruby on Rails Foreign Key Violation

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ramanan (Guest)
on 2006-06-10 03:00
I have a 3 tables.


Menus table is having many-many relationship with Application_Roles
table and is linked via join table, Menu_Roles.

I have 2 drop down in Menu_Roles view html.  The values of these 2 drop
downs are populated using "select" from Menus and Application_Roles
table.  I could see the id and the description populated in the drop
down from these two tables.   But when I try to save it (i.e. create a
record) to Menu_Roles table, I get foreign key violation with values 0,
0 selected (error messages shows the value selected are 0 and 0).

any help is greatly appreciated.
This topic is locked and can not be replied to.