I''am a beginner in programming world and i''am now several weeks learning Ruby on Rails. everything goes well exept the action destroy. I''am using the screencasts to learning programming and the old edition of the book Agile Web development with rails. In some cases the action destroy works well in others it doesn''t work. I made the code exactly as in the book but after that the destroy action doesn''t work anymore. I have did the screencast of the weblog and made a Administrator login it works well. Only the destroycomment works different. I must have for the destroycomment a seperate controller named Comment_Controller to use the action destroycomment. Only i can''t figure out why it works different. And now with making the depot from the Agile book and i get the same strange things. Please can someone tell me wht exatly changed with the destroy action. I think now this action is changed since the book and the screencasts. But i have not the expierience yet to find ut how i must use it now. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
imho, (only out of past experiences) i believe it''s because of these two lines in your controller: verify :method => :post, :only => [ :destroy ... ], :redirect_to => { :action => :list } this ''verify'' function redirects to a different page, rather than put the request through, if the action specified in the :only => [:action1, :action2, ...] array. the way to do it, is when you link over to the ''destroy'' action, add a {:post => true } option or method="post" html attribute to the link: <%= link_to "destroy the object", ({:action => ''destroy'', :id => @object}, :post => true )%> <a href="/controller/action" method="post">destroy!</a> hth, :) s -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---