<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/controllers/admin/comments_routing_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -46,6 +46,7 @@ class Admin::CommentsController &lt; ApplicationController
   rescue ActiveRecord::RecordNotFound
     redirect_to admin_comments_path
   end
+  
   def show
     redirect_to edit_admin_comment_path(params[:id])
   end</diff>
      <filename>app/controllers/admin/comments_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,11 +15,11 @@
   &lt;/td&gt;
   &lt;td class=&quot;controls right&quot;&gt;
     &lt;div class=&quot;nowrap&quot;&gt;
-      &lt;%= link_to(&quot;approve&quot;, approve_admin_comment_path(comment)) unless comment.approved? %&gt;
-      &lt;%= link_to(&quot;unapprove&quot;, unapprove_admin_comment_path(comment)) if comment.approved? %&gt;
+      &lt;%= link_to(&quot;approve&quot;, approve_admin_comment_path(comment), :method =&gt; :put) unless comment.approved? %&gt;
+      &lt;%= link_to(&quot;unapprove&quot;, unapprove_admin_comment_path(comment), :method =&gt; :put) if comment.approved? %&gt;
     &lt;/div&gt;
     &lt;div&gt;
-      &lt;%= link_to &quot;remove&quot;, admin_comment_path(comment), :method =&gt; :delete, :confirm =&gt; &quot;Are you sure?&quot; %&gt;
+      &lt;%= link_to &quot;delete&quot;, admin_comment_path(comment), :method =&gt; :delete, :confirm =&gt; &quot;Are you sure?&quot; %&gt;
     &lt;/div&gt;
     &lt;div&gt;
       &lt;%= link_to &quot;edit&quot;, edit_admin_comment_path(comment) %&gt;</diff>
      <filename>app/views/admin/comments/_comment.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
   &lt;/tbody&gt;
 &lt;/table&gt;
 
-&lt;p&gt;&lt;%= link_to &quot;Delete All Unapproved&quot;, destroy_unapproved_comments_url, :method =&gt; :delete %&gt;&lt;/p&gt;
+&lt;p&gt;&lt;%= link_to &quot;Delete All Unapproved&quot;, destroy_unapproved_admin_comments_url, :method =&gt; :delete %&gt;&lt;/p&gt;
 
 &lt;%= will_paginate @comments %&gt;
 </diff>
      <filename>app/views/admin/comments/index.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,4 @@
-begin
-  require_dependency 'application_controller'
-rescue MissingSourceFile
-  require_dependency 'application'
-end
+require_dependency 'application_controller'
 
 class CommentsExtension &lt; Radiant::Extension
   version &quot;0.0.6&quot;
@@ -10,18 +6,14 @@ class CommentsExtension &lt; Radiant::Extension
   url &quot;http://github.com/saturnflyer/radiant-comments&quot;
   
   define_routes do |map|                
+    map.namespace :admin do |admin|
+      admin.connect 'comments/:status', :controller =&gt; 'comments', :status =&gt; /all|approved|unapproved/, :conditions =&gt; { :method =&gt; :get }
+      admin.resources :comments, :member =&gt; { :remove =&gt; :get, :approve =&gt; :put, :unapprove =&gt; :put }, :collection =&gt; {:destroy_unapproved =&gt; :delete}
+      admin.page_enable_comments '/pages/:page_id/comments/enable', :controller =&gt; 'comments', :action =&gt; 'enable', :conditions =&gt; {:method =&gt; :put}
+    end
     map.with_options(:controller =&gt; 'admin/comments') do |comments| 
-      comments.destroy_unapproved_comments '/admin/comments/unapproved/destroy', :action =&gt; 'destroy_unapproved', :conditions =&gt; {:method =&gt; :delete}
-
-      comments.admin_page_enable_comments 'admin/pages/:page_id/comments/enable', :action =&gt; 'enable', :conditions =&gt; { :method =&gt; :put }
-
-      comments.connect 'admin/comments/:status', :status =&gt; /all|approved|unapproved/, :conditions =&gt; { :method =&gt; :get }
-      comments.connect 'admin/comments/:status.:format', :status =&gt; /all|approved|unapproved/, :conditions =&gt; { :method =&gt; :get }
-
       comments.connect 'admin/pages/:page_id/comments/:status', :status =&gt; /all|approved|unapproved/, :conditions =&gt; { :method =&gt; :get }
       comments.connect 'admin/pages/:page_id/comments/:status.:format', :status =&gt; /all|approved|unapproved/, :conditions =&gt; { :method =&gt; :get }
-      
-      comments.resources :comments, :path_prefix =&gt; &quot;/admin&quot;, :name_prefix =&gt; &quot;admin_&quot;, :member =&gt; {:approve =&gt; :get, :unapprove =&gt; :get}
       comments.admin_page_comments 'admin/pages/:page_id/comments/:action'
       comments.admin_page_comment 'admin/pages/:page_id/comments/:id/:action'
     end</diff>
      <filename>comments_extension.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,31 +6,6 @@ describe Admin::CommentsController do
     login_as :admin
   end
 
-  describe &quot;routing&quot; do
-    %w(all approved unapproved).each do |status|
-      it &quot;should route to the index action for #{status} comments&quot; do
-        params_from(:get, &quot;/admin/comments/#{status}&quot;).should == { :controller =&gt; &quot;admin/comments&quot;, :action =&gt; &quot;index&quot;, :status =&gt; status }
-      end
-      it &quot;should route to the index action for #{status} comments on the page&quot; do
-        params_from(:get, &quot;/admin/pages/1/comments/#{status}&quot;).should == { :controller =&gt; &quot;admin/comments&quot;, :action =&gt; &quot;index&quot;, :page_id =&gt; &quot;1&quot;, :status =&gt; status }
-      end
-    end
-
-    it &quot;should route to the destroy_unapproved action&quot; do
-      params_from(:delete, &quot;/admin/comments/unapproved/destroy&quot;).should == { :controller =&gt; &quot;admin/comments&quot;, :action =&gt; &quot;destroy_unapproved&quot; }
-    end
-
-    it &quot;should route to the enable action for the page&quot; do
-      params_from(:put, &quot;/admin/pages/1/comments/enable&quot;).should == { :controller =&gt; &quot;admin/comments&quot;, :action =&gt; &quot;enable&quot;, :page_id =&gt; &quot;1&quot; }
-    end
-
-    %w(approve unapprove).each do |action|
-      it &quot;should route to the #{action} action&quot; do
-        params_from(:get, &quot;/admin/comments/1/#{action}&quot;).should == { :controller =&gt; &quot;admin/comments&quot;, :action =&gt; action, :id =&gt; &quot;1&quot; }
-      end
-    end
-  end
-
   describe &quot;requesting 'show' with GET&quot; do
     it &quot;should redirect to the comment edit screen&quot; do
       id = comments(:first).id</diff>
      <filename>spec/controllers/admin/comments_controller_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a1b13406c0e1035b820bda3509f72f5a97e1365d</id>
    </parent>
  </parents>
  <author>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </author>
  <url>http://github.com/artofmission/radiant-comments/commit/2d6ca58ebe0502aae81c4d954f59835fb24e0522</url>
  <id>2d6ca58ebe0502aae81c4d954f59835fb24e0522</id>
  <committed-date>2009-06-20T20:27:27-07:00</committed-date>
  <authored-date>2009-06-20T20:27:27-07:00</authored-date>
  <message>cleaning up routes</message>
  <tree>54e243368c5870fe10dfc163ba009c472e683664</tree>
  <committer>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </committer>
</commit>
