Forum: Ruby on Rails problem with active record table relation

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.
160233e03537f79128c2d5dabdcf30f8?d=identicon&s=25 claudio (Guest)
on 2007-03-09 12:38
I have two tables cms_pages and cms_menus
cms_menus has a foreign key to so when i create a new link
i can
releate to a page.
Insert is fine, but when i do a list of cms_menus and i want to know the
page name
i just put but i get an error that cms_page is nil,
what is driving me crazy is the fact that if i do an
menu.cms_page.inspect i have all the information of that page. I tried

NOTHING, all the ohters models releation works fine why i have this
2017657725dd1bce83dc8a1e2e991d04?d=identicon&s=25 Luke Ivers (Guest)
on 2007-03-09 15:43
(Received via mailing list)
I can't think of any reason for that to not work other than that you
mistakenly used a bad field name... ie is not a valid
reference.  If you can reference menu.cms_page at all, then it should be
returning a full AR model, and you should be able to use it like any

If you could include the class definitions and maybe table definitions,
might be able to help more.
This topic is locked and can not be replied to.