Hello,
I am very new at this, so please keep that in mind.
I made a web application using scaffold and ruby on rails. It''s just a
very basic blog that I''m using for testing and learning.
Everything''s going great, except when I want to delete an entry.
Here''s
my code for the delete link:
<%= link_to ''delete'', { :action => "destroy"
}, :id => entry.id, :post
=> true %>
When I click this link, I get an error with the following error:
Couldn''t find Entry without an ID
Any ideas on what I''m doing wrong?
Thanks!
--
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
-~----------~----~----~----~------~----~------~--~---
croceldon :> I made a web application using scaffold and ruby on rails. It's just a > very basic blog that I'm using for testing and learning. > > Everything's going great, except when I want to delete an entry. > Here's my code for the delete link: > > <%= link_to 'delete', { :action => "destroy" }, :id => entry.id, :post > => true %> > > When I click this link, I get an error with the following error: > > Couldn't find Entry without an IDthe :id => entry.id pair is in the wrong hash : you put in the last one whereas it must be in the first one : <%= link_to 'delete', { :action => "destroy", :id => entry.id}, :post => true %> it can be written like that as well : <%= link_to 'delete', { :action => "destroy", :id => entry.id}, { :post => true } %> -- Jean-François. -- À la renverse. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> <%= link_to ''delete'', { :action => "destroy", :id => entry.id}, :post => > true %>That did it. Thanks so much! -- 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 -~----------~----~----~----~------~----~------~--~---