Forum: Radiant CMS Commenting

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.
Justin Marney (Guest)
on 2006-06-07 01:08
(Received via mailing list)
Hey Bruce,

First off, I am new to Ruby, Rails, and Radiant (bout 2 months of
now) but they are totally mind-blowing heh (So correct me where I say
totally wrong things).  Next, I actually just started work on adding
commenting abilities to Radiant.  My thoughts are a behavior is not the
way to go because one will potentially want to add the ability to
comment on
a page that already has a behavior (I am guessing in most cases the
will be some sort of blog behavior).  My next thoughts were to implement
extension as a Rails plugin.  However, I am having a lot of trouble
information on the best way to extend a model via a plugin (lots of
run into issues where thier enhancements get dropped when the model gets
reloaded in a dev environment) and it also seems like testing models in
plugins is a big pain (like I said I'm a noob so the two afformentioned
things might just be necessary hurdles).  In an effort to just get
working I went ahead and added a bunch of stuff right into Radiant,
I could pull it out into a plugin later if I solved the above problems.
added a Remark class to the model (I tried to create a comment model but
generator yeleld at me and said "comment" is a reserved rails word so
== comment from here on out) that belongs_to page.  I added has_many
to the Page model.  I added the following tags right into page_context
(that's right I held no reservations about mucking up the innards of
heh): remark, remark:each, remark:author, remark:content, remark:form
remark:form is interesting as it generates a form for creating a new
comment...In order for this to work I had to modify the process method
Behavior with something like:
if etc etc else the normal process.  This is bad because
behavior that processes a form and uses if to check for
submission will break (i.e. the mailer behavior Matt Mccray posted on
list).  All in all I just kinda dove in...but hopefully I exposed some
potential problems re: comments.  Thoughts?  I'd appriciate any
direction/help/abuse :p

This topic is locked and can not be replied to.