title: Delete confirmation rails
body: <p>I have a delete option on a scheduled message, I simply want a quick popup verification that user wanted to delete(Are You Sure?). What's the simplest way to accomplish this? </p>
  
  <p>Here is a screenshot and some code.</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;h2&gt;Listing Scheduled Messages&lt;/h2&gt;
  &lt;table class="table table-striped"&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;%= sortable 'body', 'Messages' %&gt;&lt;/th&gt;
      &lt;th&gt;&lt;%= sortable 'send_at', 'Sent Time' %&gt;&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;% @message.each do |message| %&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;%= message.body %&gt;&lt;/td&gt;
        &lt;td&gt;Send out in: &lt;%= time_ago_in_words message.send_at %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= link_to 'Edit', edit_message_path(message) %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= link_to 'Delete', message_path(message),method: :delete, :confirm=&gt;'Are you sure?' %&gt;&lt;/td&gt;
        &lt;% end %&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;p&gt;&lt;%= link_to "Send Message", root_path %&gt;&lt;/p&gt;
      &lt;/div&gt;
  </code></pre>