title: Rails 3 Nested Resources: can't get form or pages to work
body: <p>I am currently working on a web app for social networking site but it seems as if getting my nested resources to work correctly is impossible. If you can help me out that would be great and I would be very thankful. </p>
  
  <p>Here are my routes. I would like to have the url structure like mysite.com/username/photos /(new, edit, etc). The url structure is like so but I get an error when trying to access the forms or page. Down below I have posted what I have so far.</p>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>   resources :users do  
     resources :photos  
     end 
  </code></pre>
  
  <p><strong>photo.rb</strong></p>
  
  <pre><code>belongs_to :users
  </code></pre>
  
  <p><strong>user.rb</strong></p>
  
  <pre><code>has_many :photos, :foreign_key =&gt; "id", :dependent =&gt; :destroy
  </code></pre>
  
  <p><strong>_form.html.erb</strong>
  This form has an attachment using paperclip. There is a &lt;% before statement I removed it because it would not show the entire code below on here. </p>
  
  <pre><code> form_for(@photos,@user) :html =&gt; {:multipart =&gt; true} do |f| %&gt;
  </code></pre>
  
  <p><strong>photos_controller.rb</strong></p>
  
  <pre><code> def new
    @photo = Photo.new(params[:photo])
   end
  </code></pre>