I can add a League fine but when I try and add a division I get the
error:
"Couldn't find League without an ID"
I've defined the League table with 'has_many :divisions'
I've defined the Division table with 'belongs_to :league'
Here's a snippet from my divison new.rhtml
<form action="/division/new" method="post">
<input id="league_id" name="division[league_id]" value="<%=
@league.id %>"/>
<p>
<b>Division Name</b><br/>
<input id="divisionName" name="division[divisionName]" size="30"
type="text" value=""/>
</p>
You can see I have included league_id as an input field and have passed
the value
as a parameter in the url.(which is working fine, it shows up in the
input field).
When I click on the save button, that's when I get the error above.
I'm not sure
what it's trying to tell me let alone what to do to fix it.
It seems like it's complaining about not finding the league - are you
trying to find the league in your new method of your controller? I
would assume in the new method you would have something like
@league=League.find(params[:league_id])
What file is the error referring to, the form or the controller?