I have the following Rails3 nested resource in my routes.rb:
resources :books do
My authors table has ID | name | book_id
Given I'm at the URL /books/312/authors/new
I'm having problems getting a new author created for the book....
Here's my authors controller code:
@books = Book.find(params[:book_id])
@author = @book.authors.create(params[:note])
My NEW FORM (which I think is the problem, looks like this:
<%=form_for [@book , @author] do |f| %>
<%= f.submit %>
<% end %>
When I submit I get the ERROR:
"Couldn't find Book without an ID"
And the URL changes to "/books/ & NOT /books/312/authors ... as
Suggestions? Thank you