i was trying to destroy an item from my database using charges/destroy
action, and i get this message:
Processing ChargesController#destroy (for 127.0.0.1 at 2007-03-26
14:20:00) [GET]
Session ID: f7b10d423fe59d16286c3ccb2a436225
Parameters: {"action"=>"destroy", "id"=>"3",
"controller"=>"charges"}
User Load (0.001144) SELECT * FROM users WHERE (users."id" = 1)
LIMIT 1
Redirected to http://clovisgeyer.auszug.ath.cx:1337/charges/list
Filter chain halted as
[#<ActionController::Filters::ClassMethods::ProcFilter:0x2adaaef03f30
@filter=#<Proc:0x00002adaaefa7270@/usr/lib/ruby/gems/1.8/gems/
actionpack-1.13.2/lib/action_controller/verification.rb:74>>] returned
false.
Completed in 0.26078 (3 reqs/sec) | DB: 0.00114 (0%) | 302 Found
[http://clovisgeyer.auszug.ath.cx/charges/destroy/3\]
anyone already had any problem like this?
Hi Paulo,
Paulo Geyer wrote:
i was trying to destroy an item from my database
using charges/destroy action, and i get this message:
Processing ChargesController#destroy (for 127.0.0.1 at 2007-03-26
14:20:00) [GET]
...
Redirected to http://clovisgeyer.auszug.ath.cx:1337/charges/list
Your destroy action is being invoked via a GET. That's dangerous. Rails tried to help protect you from making this 'mistake' and included the following in your controller.
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
You can take the verify out if you choose to take that risk. Better yet, change the link in the view that's invoking the destroy action to use the POST method.
hth,
Bill
i've tried ":method => :delete" but didn't work, the correct method
should be :delete, no?
but it works with :post method
thanks Bill!