# Active Record Basics - Making it commentable

**URL:** <https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167>\
**Category:** Rails\
**Created:** [June 1, 2006, 2:02am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167 "2006-06-01T02:02:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 2:02am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/1 "2006-06-01T02:02:36Z")

</div>

hi everyone, I hope someone can help me out with some active record  
basics? I’ve been banging my head for the past 4 hours and I can’t seem  
to get it to work.

I am trying to add comments to a caption (just like how one adds a  
comment to a post in a blog). I seem to be able to read posts just fine  
from the DB, however, I can’t use the “recordComment” method in  
captions\_controller.rb. Any ideas? I suspect that it has something to  
do with my recordComment method? My code is posted in the below URL.

[http://www.rafb.net/paste/results/piB0aG77.html](http://www.rafb.net/paste/results/piB0aG77.html)

This the error that I get when I try to submit a comment:  
Unknown action

No action responded to recordComment

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 10:03am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/2 "2006-06-01T10:03:51Z")

</div>

try specifying also the controller…otherwise i have no idea

start\_form\_tag :controller =\> “captions”, :action =\> ‘recordComment’,  
:id =\> @caption

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 10:14am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/3 "2006-06-01T10:14:56Z")

</div>

Hi Ioana,

Thanks for the reply, however, I actually tried that and I get this  
error:

Routing Error  
Recognition failed for “/caption/recordComment/23”

If it helps at all, this is the URL that I get when I submit a comment:  
[http://localhost:3000/captions/recordComment/23](http://localhost:3000/captions/recordComment/23)

Thanks,  
Jordan

Ioana K. wrote:

> try specifying also the controller…otherwise i have no idea
> 
> start\_form\_tag :controller =\> “captions”, :action =\> ‘recordComment’,  
> :id =\> @caption

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 11:13am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/4 "2006-06-01T11:13:25Z")

</div>

Hi Ioana,

Thanks again for the reply. But I seem to have that in my routes.rb  
already:

# You can have the root of your site routed by hooking up ‘’

# – just remember to delete public/index.html.

map.connect ‘’, :controller =\> “captions”, :action =\>“list”

# Allow downloading Web Service WSDL as a file with an extension

# instead of a file named ‘wsdl’

map.connect ‘:controller/service.wsdl’, :action =\> ‘wsdl’

# Install the default route as the lowest priority.

map.connect ‘:controller/:action/:id’

Any other ideas?

Thanks again for taking the time to help me out!

Jordan

Ioana K. wrote:

> Strange.In your routes.rb do u have this:  
> "map.connect’:controller/:action/:id’ "?..or i don’t know take a  
> better look at  
> routes.rb…I think there’s the key.

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 11:24am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/5 "2006-06-01T11:24:15Z")

</div>

Give another name to your method 😃  
Sorry no idea. It’s beyond me.

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 11:28am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/6 "2006-06-01T11:28:39Z")

</div>

Ha ya that was another idea I had so I changed it from ‘def comment’ to  
‘def recordComment’…didn’t work ☹

Well thanks for trying though. I hope someone else can help me out!  
Thanks again!

Ioana K. wrote:

> Give another name to your method 😃  
> Sorry no idea. It’s beyond me.

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 10:43am UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/7 "2006-06-01T10:43:24Z")

</div>

Strange.In your routes.rb do u have this:  
"map.connect’:controller/:action/:id’ "?..or i don’t know take a  
better look at  
routes.rb…I think there’s the key.

---

<div class="post-metadata">

**Author:** ![jtei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jtei](https://www.ruby-forum.com/u/jtei)\
**Post date:** [June 1, 2006, 6:12pm UTC](https://www.ruby-forum.com/t/active-record-basics-making-it-commentable/62167/8 "2006-06-01T18:12:50Z")

</div>

Jordan I. wrote:

> Routing Error  
> Recognition failed for “/caption/recordComment/23”
> 
> If it helps at all, this is the URL that I get when I submit a comment:  
> [http://localhost:3000/captions/recordComment/23](http://localhost:3000/captions/recordComment/23)

Your URL should have a plural “captions” not singular “caption” in the  
controller piece, just like the generated URL.

–  
Josh S.  
[http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)
