Simply RESTful deletion

Evening all! I’m playing around with the new Simply RESTful plugin, and
I’ve got a question about the *_url methods.

From what I understand, given a Page model, there are three _url methods

  • page_url
  • new_page_url
  • edit_page_url

I’m a bit disturbed that there are only three, but that aside…

To delete a resource, I would say:

link_to(‘Delete’, page_url(:id => @page), :method => :delete)

And I now have a link that points to pages/1 with an attribute of
‘delete.’ It even acts as a post request, how neat.

But this isn’t what I want. I want to present the user with a
confirmation screen, first.

I’ve tried:

link_to(‘Delete’, page_url(:action => ‘delete’, :id => @page), :method
=> :get)

But Rails throws an error in my face saying it can’t convert nil into a
string. (That is patently false, but we’ll just nod our heads and move

So… what’s a guy to do? Use the traditional link_to format?

link_to(‘Delete’, :action => ‘delete’, :id => @page)

That’s totally uncool. I’m already having nightmares about the
nightmares I’ll have trying to remember when to use which technique.
(Not to mention trying to explain this to my co-worker (who’s more of a
newbie than I am).)

If there were a delete_page_url function that accepted :get as its
:method value everything would be gravy. (I think.)

Any ideas?

  • Daniel