# Comments Extension

**URL:** <https://www.ruby-forum.com/t/comments-extension/143006>\
**Category:** Radiant CMS\
**Created:** [July 14, 2008, 1:00pm UTC](https://www.ruby-forum.com/t/comments-extension/143006 "2008-07-14T13:00:52Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 14, 2008, 1:00pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/1 "2008-07-14T13:00:52Z")

</div>

I’ve just installed the Comments Extension into a new Radiant  
application. It appears to work, except that every request I make  
adds an additional link to ‘enable’ comments on the page listing  
page. After 15 requests, there’s 15 links. Restarting the server  
corrects this.

Where can I find where the extension adds the overlay to the admin  
pages?

Regards,  
Josh

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 14, 2008, 1:13pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/2 "2008-07-14T13:13:14Z")

</div>

This is a bug in 0.6.7 that occurs when run in development mode. If  
you run it in production mode it will go away, or if you freeze to the  
edge that should also take care of it.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 14, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/3 "2008-07-14T13:18:32Z")

</div>

Embarrassing for me. I’ve subscribed to this mailing list for several  
months now and seen people talk about this known bug, but never read  
them since I didn’t have an issue. Lesson learned by me, then.

Thanks Jim.

Regards,  
Josh

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [March 3, 2009, 1:03am UTC](https://www.ruby-forum.com/t/comments-extension/143006/4 "2009-03-03T01:03:07Z")

</div>

What did happen when you submitted the comment? Did you get an error?  
Typical, it will show your comment and say that it’s awaiting  
approval. In the comments tab in the admin you can then see and  
approve the comment. In your case it’s a little unclear what you did  
or what results you got.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [March 3, 2009, 9:23am UTC](https://www.ruby-forum.com/t/comments-extension/143006/5 "2009-03-03T09:23:08Z")

</div>

There is no error and it does not show up in the comments tab waiting  
for approval. When I clicked on save comment my browser pulls up me  
[http://localhost:3000/comments](http://localhost:3000/comments), however since I have not added any  
content to that page it comes up blank. I’m guessing there is  
something that needs to be added there. I have also look in the  
comments table which is blank.

On Sun, Mar 1, 2009 at 11:00 PM, Steven S.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [March 3, 2009, 10:26am UTC](https://www.ruby-forum.com/t/comments-extension/143006/6 "2009-03-03T10:26:38Z")

</div>

Bryce K. wrote:

> There is no error and it does not show up in the comments tab waiting  
> for approval. When I clicked on save comment my browser pulls up me  
> [http://localhost:3000/comments](http://localhost:3000/comments), however since I have not added any  
> content to that page it comes up blank. I’m guessing there is  
> something that needs to be added there. I have also look in the  
> comments table which is blank.

HI I’m sorry I can’t directly help with your problem here, but just to  
be clear, did you follow the instructions about using the Comments  
extension as given in the wiki page about using Radiant as a blog?  
[http://wiki.radiantcms.org/Using\_Radiant\_as\_a\_Blog](http://wiki.radiantcms.org/Using_Radiant_as_a_Blog)

Cheers,  
Mohit.  
3/3/2009 | 12:23 AM.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [March 3, 2009, 11:18am UTC](https://www.ruby-forum.com/t/comments-extension/143006/7 "2009-03-03T11:18:29Z")

</div>

Thanks for the link I’ll take a closer look at it when I get home from  
work.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [March 3, 2009, 11:46am UTC](https://www.ruby-forum.com/t/comments-extension/143006/8 "2009-03-03T11:46:41Z")

</div>

Bryce K. wrote:

> following problem(s).  
> with a 404 error for /comments. So I created that page and repeated  
> my test. Page came up fine, however the comment did not save in the  
> database. What am I missing here? Is there a tag I need to add the  
> /comments page for it to save them?

Hi Bryce

Did you run the migration?

Cheers,  
Mohit.  
3/3/2009 | 1:43 AM.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [March 3, 2009, 11:33pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/9 "2009-03-03T23:33:09Z")

</div>

After looking at the code I figured out what I was doing wrong and got  
it  
working. It seems the Comments Extension does not like it when you  
attempt  
to post comments from the home page of the site.

I do have one small question is there a way for me to skip the approval  
process? I’d rather they just be approved. I suppose I can edit the  
extension, however I was just hopping that was not necessary.

Thanks,  
Bryce

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [March 3, 2009, 7:41pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/10 "2009-03-03T19:41:45Z")

</div>

I ran both the update and migrate tasks…

rake radiant:extensions:comments:update  
rake radiant:extensions:comments:migrate

I did not see an error occur with either one of them.

I also took a look at the url you sent earlier  
[http://wiki.radiantcms.org/Using\_Radiant\_as\_a\_Blog](http://wiki.radiantcms.org/Using_Radiant_as_a_Blog) and the only thing I  
have  
not done is enable Akismet, which I understand to be optional (I will be  
doing once I get into production).

Thanks,  
Bryce

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [May 15, 2009, 3:33pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/11 "2009-05-15T15:33:08Z")

</div>

This is a bug in the extension.  
It submits comments to the\_page\_url/comments and sets up routes to  
catch that and send it to the comments controller.  
We’ll need to make an exception for the home page and perhaps create a  
custom route for it.

Are you really accepting comments on your home page, or are you  
accepting comments on content listed on the homepage but actually  
saved in another location? It’s possible that you might need to alter  
your radius code if that is the case.

On May 14, 2009, at 4:18 PM, Rafael Souza wrote:

> Anyone know how I fix it?
> 
> Thanks

Jim G.

> **[Saturn Flyer](https://www.saturnflyer.com/)**
>
> Home info

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [April 13, 2009, 2:59am UTC](https://www.ruby-forum.com/t/comments-extension/143006/12 "2009-04-13T02:59:20Z")

</div>

Bryce K. wrote:

> After looking at the code I figured out what I was doing wrong and got  
> it  
> working. It seems the Comments Extension does not like it when you  
> attempt  
> to post comments from the home page of the site.
> 
> I do have one small question is there a way for me to skip the approval  
> process? I’d rather they just be approved. I suppose I can edit the  
> extension, however I was just hopping that was not necessary.
> 
> Thanks,  
> Bryce

I think using Akismet will automatically approve the comment.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [May 15, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/13 "2009-05-15T16:18:25Z")

</div>

The home comments was only for test, the blog comments works fine now!  
=]

One more doubt, how can I turn the comments moderated? For show in page  
only  
after approved?

Thanks Jim, helped me a lot!

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [June 4, 2009, 3:10am UTC](https://www.ruby-forum.com/t/comments-extension/143006/14 "2009-06-04T03:10:24Z")

</div>

Here is the hack I put in to bypass approvals…

in comments\_controller.rb

In the def create

add this line…

comment.approved\_at = Time.now

it creates the comment with a time stamp, which indicates approval.

I get a deep error when I try to us mollom…

I would like to use it, but my customer is screaming that they have to  
have these comments working…

Radiant Comments automatic approval

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [May 15, 2009, 5:24pm UTC](https://www.ruby-forum.com/t/comments-extension/143006/15 "2009-05-15T17:24:51Z")

</div>

I saw the code and I think that, to make the comments unapproved for  
default, the way is to comment the line seven of comment.rb model:  
“#before\_save :auto\_approve”

Can someone tells me if this is the best way?

Thanks,

Rafael Souza
