Problem with active record table relation

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

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs