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? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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/listYour 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i''ve tried ":method => :delete" but didn''t work, the correct method should be :delete, no? but it works with :post method thanks Bill! On Mar 26, 2:41 pm, "Bill Walton" <bill.wal...-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> 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 tohttp://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 (seehttp://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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---