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 This the error that I get when I try to submit a comment: Unknown action No action responded to recordComment Thanks in advance! -- Posted via http://www.ruby-forum.com/.
try specifying also the controller....otherwise i have no idea start_form_tag :controller => "captions", :action => ''recordComment'', :id => @caption On 6/1/06, Jordan Isip <jordanisip@yahoo.com> wrote:> > 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 > > This the error that I get when I try to submit a comment: > Unknown action > > No action responded to recordComment > > > Thanks in advance! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers, ioana k&a http://boulangerie.wordpress.com/(way 2 new) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060601/fad39a83/attachment.html
Jordan Isip
2006-Jun-01 08:15 UTC
[Rails] Re: Active Record Basics - Making it commentable
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 Thanks, Jordan Ioana Kanda wrote:> try specifying also the controller....otherwise i have no idea > > start_form_tag :controller => "captions", :action => ''recordComment'', > :id => @caption-- Posted via http://www.ruby-forum.com/.
Ioana Kanda
2006-Jun-01 08:38 UTC
[Rails] Re: Active Record Basics - Making it commentable
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. On 6/1/06, Jordan Isip <jordanisip@yahoo.com> wrote:> > 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 > > > Thanks, > Jordan > > Ioana Kanda wrote: > > try specifying also the controller....otherwise i have no idea > > > > start_form_tag :controller => "captions", :action => ''recordComment'', > > :id => @caption > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers, ioana k&a http://boulangerie.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060601/8094db40/attachment.html
Jordan Isip
2006-Jun-01 09:13 UTC
[Rails] Re: Re: Active Record Basics - Making it commentable
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 Kanda 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.-- Posted via http://www.ruby-forum.com/.
Ioana Kanda
2006-Jun-01 09:22 UTC
[Rails] Re: Re: Active Record Basics - Making it commentable
Give another name to your method :-D Sorry no idea. It''s beyond me. On 6/1/06, Jordan Isip <jordanisip@yahoo.com> wrote:> > 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 Kanda 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. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers, ioana k&a http://boulangerie.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060601/41761cae/attachment.html
Jordan Isip
2006-Jun-01 09:28 UTC
[Rails] Re: Re: Re: Active Record Basics - Making it commentable
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 Kanda wrote:> Give another name to your method :-D > Sorry no idea. It''s beyond me.-- Posted via http://www.ruby-forum.com/.
Josh Susser
2006-Jun-01 16:13 UTC
[Rails] Re: Active Record Basics - Making it commentable
Jordan Isip 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/23Your URL should have a plural "captions" not singular "caption" in the controller piece, just like the generated URL. -- Josh Susser http://blog.hasmanythrough.com -- Posted via http://www.ruby-forum.com/.