views:

13

answers:

2

Hello. I'm diving into Ruby on Rails and I find that when I'm using the scaffold code that RoR generated for my model, it causes a confirmation box to appear that reads "Are you sure?" when I click on the delete link. What causes this to appear and how do I remove it? Thanks, I'm just trying to figure out how this all works.

A: 

The link in the template has a :confirm=>"My message here" option. If you remove that option, then it won't have a message.

Maz
+1  A: 

The scaffold link_to will look something like this:

<%= link_to "Destroy", @code, :confirm => 'Are you sure?', :method => :delete %>

Removing the :confirm => 'Are you sure?', argument to the link helper will remove the javascript confirmation alert.

Thomas McDonald