[Edit: the solution to this problem is in the routes.rb file. I have a "resource" instead of "resources" in the line ": comments"]
I follow the guide at http://guides.rubyonrails.org/getting_started.html and I am in section 9, Removing Comments. I followed the instructions step by step, and cut / pasted the code rather than typing it, so I doubt that I have a typo - it looks more like I skipped a step. I would like to fix this before continuing with the tutorial as I am a firewall new to Rails and it is still pretty foreign to me.
Any idea what is wrong?
Except for my .rb routes:
resources :posts do resource :comments end
When I try to view a comment post, I get the following error:
NoMethodError in Posts#show Showing C:/Documents and Settings/stevez/Desktop/blog/app/views/comments/_comment.html.erb where line #12 raised: undefined method `post_comment_path' for #<#<Class:0x1f13238>:0x1eecf70> Extracted source (around line #12): 9: </p> 10: 11: <p> 12: <%= link_to 'Destroy Comment', [comment.post, comment], 13: :confirm => 'Are you sure?', 14: :method => :delete %> 15: </p> Trace of template inclusion: app/views/posts/show.html.erb Rails.root: C:/Documents and Settings/stevez/Desktop/blog Application Trace | Framework Trace | Full Trace app/views/comments/_comment.html.erb:12:in `_app_views_comments__comment_html_erb___131033543_18407100' app/views/posts/show.html.erb:19:in `_app_views_posts_show_html_erb___843714715_14332200' app/controllers/posts_controller.rb:18:in `show' Request Parameters: {"id"=>"2"} Show session dump Show env dump GATEWAY_INTERFACE: "CGI/1.1" HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" HTTP_ACCEPT_CHARSET: "ISO-8859-1,utf-8;q=0.7,*;q=0.3" HTTP_ACCEPT_ENCODING: "gzip,deflate,sdch" HTTP_ACCEPT_LANGUAGE: "en-US,en;q=0.8" HTTP_CACHE_CONTROL: "max-age=0" REMOTE_ADDR: "127.0.0.1" REMOTE_HOST: "localhost" SERVER_NAME: "localhost" SERVER_PROTOCOL: "HTTP/1.1" Response Headers: None
source share