<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,3 @@
 doc/**
 pkg/**
+nbproject/**</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,6 @@
+== 0.4.0 2008-05-25
+  *Fixed: Support for namespacing in Rails. 
+
 == 0.3.2 2008-04-27
   * Merb: Added route to config/router.rb when generating resource
 </diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,6 @@ rails_generators/stage/templates/controller.rb
 rails_generators/stage/templates/data_partial.html.erb
 rails_generators/stage/templates/form_partial.html.erb
 rails_generators/stage/templates/helper.rb
-rails_generators/stage/templates/layout.html.erb
 rails_generators/stage/templates/migration.rb
 rails_generators/stage/templates/model.rb
 rails_generators/stage/templates/view_edit.html.erb</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module Stage #:nodoc:
   module VERSION #:nodoc:
     MAJOR = 0
-    MINOR = 3
-    TINY  = 2
+    MINOR = 4
+    TINY  = 0
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>lib/stage/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,33 @@
 class StageGenerator &lt; Rails::Generator::NamedBase
   default_options :skip_timestamps =&gt; false, :skip_migration =&gt; false, :skip_fixture =&gt; true
 
-  attr_reader   :controller_name,
-                :controller_class_path,
-                :controller_file_path,
-                :controller_class_nesting,
-                :controller_class_nesting_depth,
-                :controller_class_name,
-                :controller_underscore_name,
-                :controller_singular_name,
-                :controller_plural_name,
-                :singular_title_name,
-                :plural_title_name
+  attr_reader :controller_class_path,
+              :controller_class_name,
+              :controller_underscore_name,
+              :controller_plural_name,
+              :singular_title_name,
+              :plural_title_name,
+              :singular_route_method,
+              :plural_route_method
+
   alias_method  :controller_file_name,  :controller_underscore_name
   alias_method  :controller_table_name, :controller_plural_name
 
   def initialize(runtime_args, runtime_options = {})
     super
-
-    @controller_name = @name.pluralize
-
-    base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
-    @controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
-    @controller_singular_name= base_name.singularize
-    if @controller_class_nesting.empty?
+    base_name, @controller_class_path, controller_file_path, controller_class_nesting, controller_class_nesting_depth = extract_modules(@name.pluralize)
+    @controller_class_name_without_nesting, @controller_underscore_name, controller_plural_name = inflect_names(base_name)
+    controller_singular_name= base_name.singularize
+    if controller_class_nesting.empty?
       @controller_class_name = @controller_class_name_without_nesting
     else
-      @controller_class_name = &quot;#{@controller_class_nesting}::#{@controller_class_name_without_nesting}&quot;
+      @controller_class_name = &quot;#{controller_class_nesting}::#{@controller_class_name_without_nesting}&quot;
     end
 
-    @singular_title_name = @controller_singular_name.humanize
-    @plural_title_name = @controller_plural_name.humanize
+    @singular_title_name = controller_singular_name.humanize
+    @plural_title_name = controller_plural_name.humanize
+    @singular_route_method = &quot;#{@name.gsub(&quot;::&quot;, &quot;_&quot;)}_path&quot;
+    @plural_route_method = &quot;#{@name.gsub(&quot;::&quot;, &quot;_&quot;).pluralize}_path&quot;
   end
 
   def manifest
@@ -44,7 +41,6 @@ class StageGenerator &lt; Rails::Generator::NamedBase
       m.directory(File.join(&quot;app&quot;,&quot;controllers&quot;, controller_class_path))
       m.directory(File.join(&quot;app&quot;,&quot;helpers&quot;, controller_class_path))
       m.directory(File.join(&quot;app&quot;,&quot;views&quot;, controller_class_path, controller_file_name))
-      m.directory(File.join(&quot;app&quot;,&quot;views&quot;,&quot;layouts&quot;, controller_class_path))
 
       for action in stage_views
         m.template(</diff>
      <filename>rails_generators/stage/stage_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,54 +2,54 @@ class &lt;%= controller_class_name %&gt;Controller &lt; ApplicationController
   # GET /&lt;%= table_name %&gt;
   # GET /&lt;%= table_name %&gt;.xml
   def index
-    @&lt;%= table_name %&gt; = &lt;%= class_name %&gt;.find(:all)
+    @&lt;%= plural_name %&gt; = &lt;%= singular_title_name %&gt;.find(:all)
 
     respond_to do |format|
       format.html # index.html.erb
-      format.xml  { render :xml =&gt; @&lt;%= table_name %&gt; }
+      format.xml  { render :xml =&gt; @&lt;%= plural_name %&gt; }
     end
   end
 
   # GET /&lt;%= table_name %&gt;/1
   # GET /&lt;%= table_name %&gt;/1.xml
   def show
-    @&lt;%= file_name %&gt; = &lt;%= class_name %&gt;.find(params[:id])
+    @&lt;%= singular_name %&gt; = &lt;%= singular_title_name %&gt;.find(params[:id])
 
     respond_to do |format|
       format.html # show.html.erb
-      format.xml  { render :xml =&gt; @&lt;%= file_name %&gt; }
+      format.xml  { render :xml =&gt; @&lt;%= singular_name %&gt; }
     end
   end
 
   # GET /&lt;%= table_name %&gt;/new
   # GET /&lt;%= table_name %&gt;/new.xml
   def new
-    @&lt;%= file_name %&gt; = &lt;%= class_name %&gt;.new
+    @&lt;%= singular_name %&gt; = &lt;%= singular_title_name %&gt;.new
 
     respond_to do |format|
       format.html # new.html.erb
-      format.xml  { render :xml =&gt; @&lt;%= file_name %&gt; }
+      format.xml  { render :xml =&gt; @&lt;%= singular_name %&gt; }
     end
   end
 
   # GET /&lt;%= table_name %&gt;/1/edit
   def edit
-    @&lt;%= file_name %&gt; = &lt;%= class_name %&gt;.find(params[:id])
+    @&lt;%= singular_name %&gt; = &lt;%= singular_title_name %&gt;.find(params[:id])
   end
 
   # POST /&lt;%= table_name %&gt;
   # POST /&lt;%= table_name %&gt;.xml
   def create
-    @&lt;%= file_name %&gt; = &lt;%= class_name %&gt;.new(params[:&lt;%= file_name %&gt;])
+    @&lt;%= singular_name %&gt; = &lt;%= singular_title_name %&gt;.new(params[:&lt;%= singular_name %&gt;])
 
     respond_to do |format|
-      if @&lt;%= file_name %&gt;.save
-        flash[:notice] = '&lt;%= class_name %&gt; was successfully created.'
-        format.html { redirect_to(@&lt;%= file_name %&gt;) }
-        format.xml  { render :xml =&gt; @&lt;%= file_name %&gt;, :status =&gt; :created, :location =&gt; @&lt;%= file_name %&gt; }
+      if @&lt;%= singular_name %&gt;.save
+        flash[:notice] = '&lt;%= singular_title_name %&gt; was successfully created.'
+        format.html { redirect_to(@&lt;%= singular_name %&gt;) }
+        format.xml  { render :xml =&gt; @&lt;%= singular_name %&gt;, :status =&gt; :created, :location =&gt; @&lt;%= singular_name %&gt; }
       else
         format.html { render :action =&gt; &quot;new&quot; }
-        format.xml  { render :xml =&gt; @&lt;%= file_name %&gt;.errors, :status =&gt; :unprocessable_entity }
+        format.xml  { render :xml =&gt; @&lt;%= singular_name %&gt;.errors, :status =&gt; :unprocessable_entity }
       end
     end
   end
@@ -57,16 +57,16 @@ class &lt;%= controller_class_name %&gt;Controller &lt; ApplicationController
   # PUT /&lt;%= table_name %&gt;/1
   # PUT /&lt;%= table_name %&gt;/1.xml
   def update
-    @&lt;%= file_name %&gt; = &lt;%= class_name %&gt;.find(params[:id])
+    @&lt;%= singular_name %&gt; = &lt;%= singular_title_name %&gt;.find(params[:id])
 
     respond_to do |format|
-      if @&lt;%= file_name %&gt;.update_attributes(params[:&lt;%= file_name %&gt;])
-        flash[:notice] = '&lt;%= class_name %&gt; was successfully updated.'
-        format.html { redirect_to(@&lt;%= file_name %&gt;) }
+      if @&lt;%= singular_name %&gt;.update_attributes(params[:&lt;%= singular_name %&gt;])
+        flash[:notice] = '&lt;%= singular_title_name %&gt; was successfully updated.'
+        format.html { redirect_to(@&lt;%= singular_name %&gt;) }
         format.xml  { head :ok }
       else
         format.html { render :action =&gt; &quot;edit&quot; }
-        format.xml  { render :xml =&gt; @&lt;%= file_name %&gt;.errors, :status =&gt; :unprocessable_entity }
+        format.xml  { render :xml =&gt; @&lt;%= singular_name %&gt;.errors, :status =&gt; :unprocessable_entity }
       end
     end
   end
@@ -74,8 +74,8 @@ class &lt;%= controller_class_name %&gt;Controller &lt; ApplicationController
   # DELETE /&lt;%= table_name %&gt;/1
   # DELETE /&lt;%= table_name %&gt;/1.xml
   def destroy
-    @&lt;%= file_name %&gt; = &lt;%= class_name %&gt;.find(params[:id])
-    @&lt;%= file_name %&gt;.destroy
+    @&lt;%= singular_name %&gt; = &lt;%= singular_title_name %&gt;.find(params[:id])
+    @&lt;%= singular_name %&gt;.destroy
 
     respond_to do |format|
       format.html { redirect_to(&lt;%= table_name %&gt;_url) }</diff>
      <filename>rails_generators/stage/templates/controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,12 @@
 class &lt;%= migration_name %&gt; &lt; ActiveRecord::Migration
   def self.up
     create_table :&lt;%= table_name %&gt; do |t|
-		&lt;% for attribute in attributes -%&gt;
+&lt;% for attribute in attributes -%&gt;
       t.&lt;%= attribute.type %&gt; :&lt;%= attribute.name %&gt;
-		&lt;% end -%&gt;
-		&lt;% unless options[:skip_timestamps] %&gt;
+&lt;% end -%&gt;
+&lt;% unless options[:skip_timestamps] %&gt;
       t.timestamps
-		&lt;% end -%&gt;
+&lt;% end -%&gt;
     end
   end
 </diff>
      <filename>rails_generators/stage/templates/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,5 +2,5 @@
 
 &lt;%%= render :partial =&gt; &quot;form&quot; %&gt;
 
-&lt;%%= link_to 'Show', @&lt;%= singular_name %&gt; %&gt; |
-&lt;%%= link_to 'Back', &lt;%= plural_name %&gt;_path %&gt;
+&lt;%%= link_to 'Show', &lt;%= &quot;#{singular_route_method}(@#{singular_name})&quot; %&gt; %&gt; |
+&lt;%%= link_to 'Back', &lt;%= plural_route_method %&gt; %&gt;</diff>
      <filename>rails_generators/stage/templates/view_edit.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -12,13 +12,13 @@
 &lt;% for attribute in attributes -%&gt;
     &lt;td&gt;&lt;%%=h &lt;%= singular_name %&gt;.&lt;%= attribute.name %&gt; %&gt;&lt;/td&gt;
 &lt;% end -%&gt;
-    &lt;td&gt;&lt;%%= link_to 'Show', &lt;%= singular_name %&gt; %&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;%%= link_to 'Edit', edit_&lt;%= singular_name %&gt;_path(&lt;%= singular_name %&gt;) %&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;%%= link_to 'Destroy', &lt;%= singular_name %&gt;, :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%%= link_to 'Show', &lt;%= &quot;#{singular_route_method}(#{singular_name})&quot; %&gt; %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%%= link_to 'Edit', &lt;%= &quot;edit_#{singular_route_method}(#{singular_name})&quot; %&gt; %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%%= link_to 'Destroy', &lt;%= &quot;#{singular_route_method}(#{singular_name})&quot; %&gt;, :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt;&lt;/td&gt;
   &lt;/tr&gt;
 &lt;%% end %&gt;
 &lt;/table&gt;
 
 &lt;br /&gt;
 
-&lt;%%= link_to 'New &lt;%= singular_title_name %&gt;', new_&lt;%= singular_name %&gt;_path %&gt;
+&lt;%%= link_to 'New &lt;%= singular_title_name %&gt;', new_&lt;%= singular_route_method %&gt; %&gt;</diff>
      <filename>rails_generators/stage/templates/view_index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -2,4 +2,4 @@
 
 &lt;%%= render :partial =&gt; &quot;form&quot; %&gt;
 
-&lt;%%= link_to 'Back', &lt;%= plural_name %&gt;_path %&gt;
+&lt;%%= link_to 'Back', &lt;%= plural_route_method %&gt; %&gt;</diff>
      <filename>rails_generators/stage/templates/view_new.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
 &lt;%%= render :partial =&gt; &quot;data&quot; %&gt;
 
-&lt;%%= link_to 'Edit', edit_&lt;%= singular_name %&gt;_path(@&lt;%= singular_name %&gt;) %&gt; |
-&lt;%%= link_to 'Back', &lt;%= plural_name %&gt;_path %&gt;
+&lt;%%= link_to 'Edit', &lt;%= &quot;edit_#{singular_route_method}(@#{singular_name})&quot; %&gt; %&gt; |
+&lt;%%= link_to 'Back', &lt;%= plural_route_method %&gt; %&gt;</diff>
      <filename>rails_generators/stage/templates/view_show.html.erb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>rails_generators/stage/templates/layout.html.erb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>42751b1d27647c513d82e8dc9c3b69c8b8d48b85</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Stone</name>
    <email>andy@stonean.com</email>
  </author>
  <url>http://github.com/stonean/stage/commit/9de365bb82bdb18aae2d59b70873d07b35647cc9</url>
  <id>9de365bb82bdb18aae2d59b70873d07b35647cc9</id>
  <committed-date>2008-05-25T20:02:52-07:00</committed-date>
  <authored-date>2008-05-25T20:02:52-07:00</authored-date>
  <message>fix for namespacing resources.  rails only</message>
  <tree>e8c4675c2563625fb98df6a2432ace83f7b250b0</tree>
  <committer>
    <name>Andrew Stone</name>
    <email>andy@stonean.com</email>
  </committer>
</commit>
