Ciao,
ho aggiunto nel mio controller photos_controller un azione chiamata destroymany.
Questo è il mio file routes.rb
codice:
ActionController::Routing::Routes.draw do |map|
map.resources :photos, :collection => { :destroymany => :get}
map.root :controller => 'photos'
end
Ora nella mia view chiamo il seguete link
codice:
<%= link_to_remote "delete", :url => { :controller => :photos, :action => :destroymany }, :with =>"'delete_photo_array='+getElementInBoard()" %>
e non riesco a capire perchè va a chiamare index
codice:
Processing ApplicationController#index (for 127.0.0.1 at 2009-06-19 23:26:49) [P
OST]
Parameters: {"delete_photo_array"=>"132", "authenticity_token"=>"sK5wSMJu5yy6I
pfNmEEVPL5uxhWXkW3ls2b3B/dfSGM="}
ActionController::MethodNotAllowed (Only get, put, and delete requests are allow
ed.):
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
Rendered rescues/_trace (94.0ms)
Rendered rescues/_request_and_response (0.0ms)
Rendering rescues/layout (method_not_allowed)
Cosa mi sfugge?