<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *Edge*
 
+* Added FormTagHelper#image_submit_tag confirm option #784 [Alastair Brunton]
+
 * Fixed FormTagHelper#submit_tag with :disable_with option wouldn't submit the button's value when was clicked #633 [Jose Fernandez]
 
 * Stopped logging template compiles as it only clogs up the log [DHH]</diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -371,6 +371,9 @@ module ActionView
       # &lt;tt&gt;source&lt;/tt&gt; is passed to AssetTagHelper#image_path
       #
       # ==== Options
+      # * &lt;tt&gt;:confirm =&gt; 'question?'&lt;/tt&gt; - This will add a JavaScript confirm
+      #   prompt with the question specified. If the user accepts, the form is
+      #   processed normally, otherwise no action is taken.
       # * &lt;tt&gt;:disabled&lt;/tt&gt; - If set to true, the user will not be able to use this input.
       # * Any other key creates standard HTML options for the tag.
       #
@@ -387,6 +390,13 @@ module ActionView
       #   image_submit_tag(&quot;agree.png&quot;, :disabled =&gt; true, :class =&gt; &quot;agree-disagree-button&quot;)
       #   # =&gt; &lt;input class=&quot;agree-disagree-button&quot; disabled=&quot;disabled&quot; src=&quot;/images/agree.png&quot; type=&quot;image&quot; /&gt;
       def image_submit_tag(source, options = {})
+        options.stringify_keys!
+
+        if confirm = options.delete(&quot;confirm&quot;)
+          options[&quot;onclick&quot;] ||= ''
+          options[&quot;onclick&quot;] += &quot;return #{confirm_javascript_function(confirm)};&quot;
+        end
+
         tag :input, { &quot;type&quot; =&gt; &quot;image&quot;, &quot;src&quot; =&gt; path_to_image(source) }.update(options.stringify_keys)
       end
 </diff>
      <filename>actionpack/lib/action_view/helpers/form_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -241,6 +241,13 @@ class FormTagHelperTest &lt; ActionView::TestCase
       submit_tag(&quot;Save&quot;, :confirm =&gt; &quot;Are you sure?&quot;)
     )
   end
+  
+  def test_image_submit_tag_with_confirmation
+    assert_dom_equal(
+      %(&lt;input type=&quot;image&quot; src=&quot;/images/save.gif&quot; onclick=&quot;return confirm('Are you sure?');&quot;/&gt;),
+      image_submit_tag(&quot;save.gif&quot;, :confirm =&gt; &quot;Are you sure?&quot;)
+    )
+  end
 
   def test_pass
     assert_equal 1, 1</diff>
      <filename>actionpack/test/template/form_tag_helper_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>184cf27b1244734a33833cf2cb9b8062e9ee8a63</id>
    </parent>
  </parents>
  <author>
    <name>Alastair Brunton</name>
    <email>info@simplyexcited.co.uk</email>
  </author>
  <url>http://github.com/rails/rails/commit/b141624abbd1be6aa9836708fe4c20c03af5ab3b</url>
  <id>b141624abbd1be6aa9836708fe4c20c03af5ab3b</id>
  <committed-date>2008-09-09T22:13:35-07:00</committed-date>
  <authored-date>2008-08-08T06:55:50-07:00</authored-date>
  <message>Added image_submit_tag confirm option [status:committed #784]

Signed-off-by: David Heinemeier Hansson &lt;david@loudthinking.com&gt;</message>
  <tree>101054db556e9941b55e2bc9fc111516344b4033</tree>
  <committer>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </committer>
</commit>
