Hello: I have a destroy method in my controller - pretty standard: def destroy @goal = Goal.find(params[:id]) respond_to do |format| format.html { redirect_to goals_url } format.xml { head :ok } end end And then I have a listing view which has the destroy method in the view - also pretty standard: <%= link_to ''Delete'', { :action => ''destroy'', :id => goal }, :confirm => ''Are you sure?'', :post => true %> |  where the id = goal id - no problem retreiving that, becuase i see it in my URL: [myurl.com]/goals/13 but this is called, I get an error: Unknown action No action responded to 13 How can this be the case when the destroy method is correctly being referenced in my view? Thank you very much in advance for any help you can provide. Mike --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Hello: > > I have a destroy method in my controller - pretty standard: > > def destroy > @goal = Goal.find(params[:id]) > respond_to do |format| > format.html { redirect_to goals_url } > format.xml { head :ok } > end > end > > And then I have a listing view which has the destroy method in the view > - also pretty standard: > > <%= link_to ''Delete'', { :action => ''destroy'', :id => goal }, :confirm > => ''Are you sure?'', :post => true %> |  > > where the id = goal id - no problem retreiving that, becuase i see it > in my URL: > > [myurl.com]/goals/13 > > but this is called, I get an error: > > Unknown action > > No action responded to 13 > > How can this be the case when the destroy method is correctly being > referenced in my view?Look at your routes file... somewhere you have a route that is matching this and messing you up. Rails thinks that ''13'' is the action. Something in your routes is making the action not get picked up. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It has to be url/controller_name/action_name/id .. so in your case it should be like url/goals/destroy/13 ... hope this helps ... -- 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 -~----------~----~----~----~------~----~------~--~---