<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -209,6 +209,11 @@ module ScaffoldingExtensions
         content
       end
       
+      # Is the action given an idempotent action?  True for show and edit, false otherwise
+      def scaffold_idempotent_action?(action)
+        [:show, :edit].include?(action)
+      end
+
       # Script tag with javascript included inside a CDATA section
       def scaffold_javascript_tag(javascript)
         &quot;&lt;script type='text/javascript'&gt;\n//&lt;![CDATA[\n#{javascript}\n//]]&gt;\n&lt;/script&gt;&quot;</diff>
      <filename>lib/scaffolding_extensions/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 &lt;% @scaffold_title = &quot;Choose #{hn = @scaffold_options[:singular_lc_human_name]} to #{(haction = (action = @scaffold_action).to_s.humanize).downcase}&quot; %&gt;
 
-&lt;%= scaffold_form(scaffold_url(&quot;#{action}#{@scaffold_suffix}&quot;), :method=&gt;(action == :destroy ? :post : :get)) %&gt;
+&lt;%= scaffold_form(scaffold_url(&quot;#{action}#{@scaffold_suffix}&quot;), :method=&gt;scaffold_idempotent_action?(action) ? :get : :post) %&gt;
 &lt;% if @scaffold_class.scaffold_use_auto_complete %&gt;
   &lt;%= scaffold_text_field_tag_with_auto_complete('id', @scaffold_options[:singular_name]) %&gt;
 &lt;% else %&gt;</diff>
      <filename>scaffolds/list.rhtml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>692fc9f96fca7026aea19c9826e329b8c832b968</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </author>
  <url>http://github.com/jeremyevans/scaffolding_extensions/commit/314939e4ccbca9147fd1f167c476cd6dcce518eb</url>
  <id>314939e4ccbca9147fd1f167c476cd6dcce518eb</id>
  <committed-date>2009-05-27T16:42:54-07:00</committed-date>
  <authored-date>2009-05-27T16:42:54-07:00</authored-date>
  <message>In list scaffold, assume only show and edit actions are idempotent

Previously, it assumed that all actions but destroy were idempotent.
Now, scaffolding extensions only supports show, edit, and destroy by
default, but it's fairly easy to extend to support other actions,
and it's safer to assume that those methods won't be idempotent.

This adds the scaffold_idempotent_method? helper method which can
be overridden if you want to add custom idempotent methods that
use get instead of post.</message>
  <tree>894615097700db4b284dab8bbed312f7774ec245</tree>
  <committer>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </committer>
</commit>
