Hi Folks… Longtime Radiant user, just getting started with Mental
I am creating an extension for posting and managing Comments. I’ve
created the Comment model, my controllers, and views in the new
Extension, but I’m having trouble extending Radiant’s built-in Page
model to include the proper has_many association.
In a nutshell: I want to include a has_many association in the Page
It seems like I should be able to just open the Page class and
include my association like this:
class Page < ActiveRecord::Base
This doesn’t work, of course. It doesn’t return an error - as far as
I can tell it just doesn’t do anything. Referencing @page.comments in
my views throws an error: “undefined method `comments’”. I presume
it’s because it is ignoring this class.
I’ve also tried several module mix-ins that haven’t worked (i.e.
packaging a PageExtender module and then including it in Page). For
Page.send :include, PageExtender
But this terminates with
page_extender.rb:8: undefined method `has_many’ for