title: rails scaffold generation and simple foreign key references problem
body: <p>My issue seems to be somewhere in the default generated scaffold forms when using foreign key references in  your model.</p>
  
  <p>I'll detail out the sequence of generations i ran before i got to my problem:</p>
  
  <p>rails generate scaffold Course name:text desc:text url:string slope:integer rating:float</p>
  
  <p>rails generate scaffold Event name:text desc:text eventdate:date course:references</p>
  
  <p>rake db:migrate</p>
  
  <p>..</p>
  
  <p>At this point I go to the courses page and create a new course and save it.  That works fine.</p>
  
  <p>Then I go to the localhost:3000/events/new page and I try to create a new event using the default form:
  The form is like this:
  name: textbox
  desc: textbox
  eventdate: [fill in date widget]
  course_id: textbox   </p>
  
  <p>I fill in the fields with some information and then "1" in the course_id field, and hit save the error returns with something to the effect of:</p>
  
  <p>Error (#xxxxxxxx) Expected, Got String(#xxxxxxxx)    ... Then a stack trace.</p>
  
  <p>So from what I can see I can tell that i don't think it likes the course_id being passed as a string value, but I can't seem to find where in the framework i need to retrieve that value and convert it to an integer.</p>
  
  <p>The bizarre thing is that the integer value entries in the other table have no issues converting, it just seems that the foreign_key reference is giving it problems.</p>
  
  <p>In the past with rails I've never used the "references" type, and I usually created foreign_key's by making them manually in the scaffold, like so the my generation would have course_id:integer instead of course:references.  Then I manually add the belongs_to into the model from that point.</p>
  
  <p>Anyway.  I could go about doing it the old way but I wanted to get some insight into what Rails 3.0 is doing with this "references" type.</p>