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.
views:
13answers:
2
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
2010-10-14 21:51:49
+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
2010-10-14 21:55:11