<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,7 @@
 
 === Edge
 
+* Moved template_name to ApplicationController [Jim Gay, Michael Kessler]
 * Remove vizres plugin. [Sean Cribbs]
 * Update instance config/environments to remove ResponseCache [Jim Gay]
 * Remove :order option from &lt;r:children:count /&gt;, which causes errors on</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,7 @@ core:
 
 === Edge
 
+* Michael Kessler
 * Sean Cribbs
 * David Cato
 * Kunal Shah</diff>
      <filename>CONTRIBUTORS</filename>
    </modified>
    <modified>
      <diff>@@ -69,19 +69,6 @@ class Admin::ResourceController &lt; ApplicationController
     response_for :destroy
   end
 
-  def template_name
-    case self.action_name
-    when 'index'
-      'index'
-    when 'new','create'
-      'new'
-    when 'edit', 'update'
-      'edit'
-    when 'remove', 'destroy'
-      'remove'
-    end
-  end
-
   protected
 
     def rescue_action(exception)</diff>
      <filename>app/controllers/admin/resource_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,19 @@ class ApplicationController &lt; ActionController::Base
   def include_javascript(script)
     @javascripts &lt;&lt; script
   end
+
+  def template_name
+    case self.action_name
+    when 'index'
+      'index'
+    when 'new','create'
+      'new'
+    when 'edit', 'update'
+      'edit'
+    when 'remove', 'destroy'
+      'remove'
+    end
+  end
   
   def rescue_action_in_public(exception)
     case exception</diff>
      <filename>app/controllers/application_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,4 +38,29 @@ describe ApplicationController do
     controller.send :set_javascripts_and_stylesheets
     controller.include_javascript('test').should include('test')
   end
+  
+  describe 'self.template_name' do
+    it &quot;should return 'index' when the controller action_name is 'index'&quot; do
+      controller.stub!(:action_name).and_return('index')
+      controller.template_name.should == 'index'
+    end
+    ['new', 'create'].each do |action|
+      it &quot;should return 'new' when the action_name is #{action}&quot; do
+      controller.stub!(:action_name).and_return(action)
+      controller.template_name.should == 'new'
+      end
+    end
+    ['edit', 'update'].each do |action|
+      it &quot;should return 'edit' when the action_name is #{action}&quot; do
+      controller.stub!(:action_name).and_return(action)
+      controller.template_name.should == 'edit'
+      end
+    end
+    ['remove', 'destroy'].each do |action|
+      it &quot;should return 'remove' when the action_name is #{action}&quot; do
+      controller.stub!(:action_name).and_return(action)
+      controller.template_name.should == 'remove'
+      end
+    end
+  end
 end</diff>
      <filename>spec/controllers/application_controller_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>134c349c118af6cda739d3ed6d3d5efe2d991cfd</id>
    </parent>
  </parents>
  <author>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </author>
  <url>http://github.com/radiant/radiant/commit/322e5c16d21fc599ac339378873ee931ae9d60ef</url>
  <id>322e5c16d21fc599ac339378873ee931ae9d60ef</id>
  <committed-date>2009-06-12T06:46:49-07:00</committed-date>
  <authored-date>2009-06-12T06:46:49-07:00</authored-date>
  <message>moved template_name into ApplicationController for controllers that don't inherit from Admin::ResourceController but use UI regions</message>
  <tree>98749f34d02b3e02b19d0a3c804b6ac546ab111c</tree>
  <committer>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </committer>
</commit>
