title: Rails nested resource creation on separate pages
body: <pre><code>resources :books do 
      resources :chapters
  end
  </code></pre>
  
  <p>Let's assume I have the above properly nested resources. I want to create a page where I create parent book resources and another page to create the chapters resources. When creating chapters, I want users to be able to select parent books they created.</p>
  
  <p>Right now I have...</p>
  
  <pre><code>protected
  def find_book
      @book = Book.find(params[:book_id])
  end
  </code></pre>
  
  <p>...in the chapter controller but I believe this only works when there is already a book id present in the URL. So to create a new chapter I would have to visit "rootpath/book/book_id/chapter/new" when I want to be able to create chapters on a separate page.</p>
  
  <p>Although I'm really not sure how to approach the problem, right now my plan is to put an association(?) form on the chapter creation page that links the nested resources.</p>
  
  <p>The problem is, I'm really new to web development and I'm not sure if I'm approaching this right at all. How would I put a form that sends :book_id to the chapter controller? Would this method work at all? Are there more efficient ways to go at it?</p>
  
  <p>I realize my questions might be a little vague but <strong>Any help</strong> would be greatly appreciated!</p>