Well, you can prevent Rails from creating that route for you using :except or :only in the routes.rb and then add a collection route with the same name (if you need examples on that, you can follow the link in my signature). Technically that solves your problem. But this is for removing a collection, for example an admin action to delete all logs older than x-month. Can you explain with an example what your really want to do?
Markus -- http://www.communityguides.eu On Sunday, March 20, 2011 6:12:16 PM UTC+1, Ruby-Forum.com User wrote: > > Hi Markus, > > I think I haven't been clear enough, the default resource is set up for > individual members, rake routes gives me this: > > ... > DELETE /appearances/:id(.:format) > ... > > Whereas I actually want to create a route for deleting a collection: > > ... > DELETE /appearances > ... > > But I don't believe this is created by default, I get a no route error > when calling delete on just the controller without an id. > > So in short - I actually want to have a route to delete a whole > collection, but the default resources method in routes.rb creates a > delete method for a member, and doesn't set up a route for deleting a > collection. I would like to know how to add a delete route for a > collection. > > Thanks! > > Markus Proske wrote in post #988427: > > Hi, > > > > a collection routes is meant to work on the whole collection. Example > > for a > > collection delete would be for example to delete all books that are out > > of > > print. If you want to delete a particular book the member route is > > perfect....how would you otherwise know in your controller, which book > > to > > delete? > > > > Markus > > > > -- > > http://www.communityguides.eu > > -- > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

