Delete :confirm => "Sure?"

Hey all, well I have a delete function in my rails application that works successfully. When I click the button it deletes the record from the page as well as the database, my problem is that I don't want it to instantaneously do this, I want it to give the user the option to cancel before hand. How would I do this. My code for the button is as followed:

_form.html.erb/games

<%= f.submit %>     <%= button_to 'Destroy', root_url, :confirm => 'Sure?', :method => :delete %>

Application.html.erb

<head>   <title>Wishlist</title>   <%= stylesheet_link_tag "/stylesheet/style", :media => "all"%>   <%= javascript_include_tag :all %>   <%= csrf_meta_tags %> </head>

Anything I am missing?

Mine work fine here, what rails version did you use.

Im using 3.2 here, make sure that the page include:

or something similar.

Ahmy Yulrizka

Regarding the asset pipeline, I think it is better to write

<%= javascript_include_tag ``"application" %>

so that the application will also correctly use the MD5 fingerprinted names in production.

I would avoid writing the src url manually and always use the javascript_include_tag.

HTH,

Peter

<%= javascript_include_tag "application" %>

That line worked great Pete, It is all sorted now.

Just wondering why it works with the "application" and not the :all?

Thanks.