<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pragmatic Forums | Posts in topic 'Recipe 13: Confirm delete on remove event?'</title>
    <link>/forums/43/topics/3434.rss</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>Recipe 13: Confirm delete on remove event? posted by Anatoly Mikhaylov @ Mon, 14 Dec 2009 18:43:41 +0000</title>
      <description>&lt;p&gt;&amp;lt;%= link_to_function(“Remove”, ”if (confirm(&amp;#8216;Really?&amp;#8217;)) $(this).up(’.task’).remove()”) %&amp;gt;&lt;/p&gt;</description>
      <pubDate>Mon, 14 Dec 2009 18:43:41 +0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:43:3434:13800</guid>
      <author>Anatoly Mikhaylov</author>
      <link>http://forums.pragprog.com/forums/43/topics/3434</link>
    </item>
    <item>
      <title>Recipe 13: Confirm delete on remove event? posted by Michael H @ Mon, 05 Oct 2009 19:39:20 +0000</title>
      <description>&lt;p&gt;Hi all,&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m using a straight forward implementation of Ryan&amp;#8217;s dynamic add/remove functionality from Recipe 13 of the book.  It&amp;#8217;s all working well, but I&amp;#8217;d like to add a standard confirm delete dialogue, just like how Rails normally does it.  I.e. when the user clicks the &amp;#8220;remove&amp;#8221; link, I want him to simply confirm that he actually wants to delete the item.  Otherwise, it all happens too fast and isn&amp;#8217;t very user friendly.&lt;/p&gt;


	&lt;p&gt;I tried implementing this by adding a call to the link_to_function line in the _task.html.erb file, but that didn&amp;#8217;t work.&lt;/p&gt;


	&lt;p&gt;I tried these approaches:&lt;/p&gt;


	&lt;p&gt;&amp;lt;%= link_to_function &amp;#8220;Remove&amp;#8221;, &amp;#8221;$(this).up(&amp;#8217;.task&amp;#8217;).remove()&amp;#8221;, :class =&amp;gt; &amp;#8216;delete&amp;#8217;, :confirm =&amp;gt; &amp;#8216;Are you sure?&amp;#8217; %&amp;gt;&lt;/p&gt;


	&lt;p&gt;&amp;lt;%= link_to_function &amp;#8220;Remove&amp;#8221;, &amp;#8221;$(this).up(&amp;#8217;.task&amp;#8217;).remove()&amp;#8221;, :confirm =&amp;gt; &amp;#8216;Are you sure?&amp;#8217; %&amp;gt;&lt;/p&gt;


	&lt;p&gt;Neither one works.&lt;/p&gt;


	&lt;p&gt;Anybody have a good solution?  Thanks!&lt;/p&gt;</description>
      <pubDate>Mon, 05 Oct 2009 19:43:13 +0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:43:3434:12598</guid>
      <author>Michael H</author>
      <link>http://forums.pragprog.com/forums/43/topics/3434</link>
    </item>
  </channel>
</rss>
