:action=>:destroy, symbols
I'm working through some book exercises & updating them to work with the Rails 2.0.2 that I've installed. Apart from the questions attached to the code samples below (I only left the javascript stuff that changed for readability), why is :method=>:delete (now vs before 2.0.* examples) required when :action=>:destroy is also present? Also, does anyone know of a reference that explains where or how symbols are defined? It's great to read that symbols are awesome, but that doesn't explain anything.
- Ok
link_to( "Delete", { :id=>photo, :action=>:destroy }, { :confirm => "Are you sure?", :method => :delete })<a href="/photos/1" onclick="javascript m.setAttribute('value', 'delete');">Delete</a> - Why is :action=>:destroy necessary here, but not in #6?
link_to( "Delete", { :id=>photo }, { :confirm => "Are you sure?", :method=>:delete })<a href="/photos/index/1" onclick="javascript m.setAttribute('value', 'delete');">Delete</a> - Ok
link_to( "Delete", { :id=>photo.id, :action=>:destroy }, { :confirm => "Are you sure?", :method => :delete })<a href="/photos/1" onclick="javascript m.setAttribute('value', 'delete');">Delete</a> - Is :action=>:delete invalid because there is not a defined delete method in photos_controller.rb?
link_to( "Delete", { :id=>photo.id, :action=>:delete }, { :confirm => "Are you sure?", :method => :delete })<a href="/photos/delete/1" onclick="javascript m.setAttribute('value', 'delete');">Delete</a> - Why is :action=>:destroy necessary here, but not in #6?
link_to( "Delete", { :id=>photo.id }, { :confirm => "Are you sure?", :method=>:delete })<a href="/photos/index/1" onclick="javascript m.setAttribute('value', 'delete');">Delete</a> - Ok
link_to( "Delete", photo, { :confirm => "Are you sure?", :method => :delete })<a href="/photos/1" onclick="javascript m.setAttribute('value', 'delete');">Delete</a>
