title: Rails 3 nesting resources or not?
body: <p>I have a "Company" which has "Projects" within them. As time goes on we now need to add "Links" that are related to "Projects". My routes currently look like the following:    </p>
  
  <pre><code>resources :companies do
    resources :projects do
      resources :links
    end
  end
  </code></pre>
  
  <p>This seems wrong due to the nesting 2 levels deep. I also no longer have <code>new_company_project_path(@company)</code> anymore if I nest like this which now denies me to ever creating projects for a company. </p>
  
  <p>I will need to add other models to relate to Projects in the coming months.</p>
  
  <p>Here is my Projects model and my Links model as well..</p>
  
  <pre><code>class Link &lt; ActiveRecord::Base
    attr_accessible :link_name, :url, :description
  
    belongs_to :project
  end
  
  class Project &lt; ActiveRecord::Base
    belongs_to :company
    belongs_to :user
  
    validates :title, :presence =&gt; true
  
    validates :description, :presence =&gt; true,
                            :length   =&gt; { :minimum =&gt; 10 } 
  end
  </code></pre>
  
  <p>It would seem nesting is not the proper way. If nesting is not the proper way, how does one go about saving the association? For example, in my current controller I save my nested objects by doing this:</p>
  
  <pre><code>class ProjectsController &lt; ApplicationController
    before_filter :authenticate_user!
    before_filter :find_company
  
    def new
      @project = @company.projects.build
    end
  
    def create
      @project = @company.projects.build(params[:project])
      if @project.save
        flash[:notice] = "Project has been created."
        redirect_to [@company, @project]
      else
        flash[:alert] = "Project has not been created."
        render :action =&gt; "new"
      end
    end
  
    private
      def find_company
        @company = Company.find(params[:company_id])
      end
  end
  </code></pre>
  
  <p>I can't find too much info on this subject and the books I read before used nesting routes only 1 level deep and others don't nest at all.</p>
  
  <p>So, what is the best way to do this so that I can have "Links" and other models related to "Projects" while "Projects" remain related to "Companies"?</p>