Can't leave comment

Forums > Book - Chapter 12 > Can't leave comment

Login to post a new topic

Author Message
jeff1123
Member since 07 Aug 13:15
0 posts

I have a problem, I just using the blog_entry usertemplate code from the book, but when I leave a comment from my entry, it appears some error message:
ActionController::MethodNotAllowed
Only get, put, and delete requests are allowed.
Request
Parameters:
{“commit”=>Submit,
“comment”=>{“body”=>”1111”}}
Show session dump
Response
Headers:
{“cookie”=>[],
“Cache-Control”=>”no-cache”,
“Allow”=>”GET,
PUT,
DELETE”}

jeff1123
Member since 07 Aug 13:15
0 posts

can anyone help me?

jeff1123
Member since 07 Aug 13:15
0 posts

before I added usertemplate, I can leave comment in my blog entry, and the console output below:
------
Processing CommentsController#create (for 127.0.0.1 at 2008-08-23 03:20:42) [POST]
Session ID: BAh7CDoMY3NyZl9pZCIlNzVhOTVlYTRjMmM2ZDQ2NmE2YzYzNzkyZGQ2ZDNk
NmY6CXVzZXJpByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6
OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==
-4327e7eb988e34b41ff3952a5531b07014ef822d
Parameters: {“commit”=>”������”, “entry_id”=>”13”, “authenticity_token”=>”2df3a95cf3f49d2c48e1e705813af4d368570540”, “action”=>”create”, “controller”=>”comments”, “user_id”=>”2”, “comment”=>{“body”=>”yes!”}}
-----
after i apply the usertemplate, the blog comment is broke, and the console output below:
-----
Processing CommentsController#create (for 127.0.0.1 at 2008-08-23 03:20:42) [POST]
Session ID: BAh7CDoMY3NyZl9pZCIlNzVhOTVlYTRjMmM2ZDQ2NmE2YzYzNzkyZGQ2ZDNk
NmY6CXVzZXJpByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6
OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==-4327e7eb988e34b41ff3952a5531b07014ef822d
Parameters: {“commit”=>”������”, “entry_id”=>”13”, “authenticity_token”=>”2df3a95cf3f49d2c48e1e705813af4d368570540”, “action”=>”create”, “controller”=>”comments”, “user_id”=>”2”, “comment”=>{“body”=>”yes!”}}
------
what problem with it?

xss
Member since 29 Aug 04:02
0 posts

has anybody found a solution .. i was prove this yesterday. on rails 2.1 …
and i get the same error…



ActionController::MethodNotAllowed


Only get, put, and delete requests are allowed.



RAILS_ROOT: /Users/test/rails2.1/test
Application Trace | Framework Trace | Full Trace
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/recognition_optimisation.rb:65:in `recognize_path’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:384:in `recognize’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in `process’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `synchronize’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `process’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in `run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `each’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load’
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/commands/servers/mongrel.rb:64
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39