My models are:
class Event < ActiveRecord::Base
class Location < ActiveRecord::Base
<%= datetime_select ‘event’, ‘meet_at’, :start_year => 2006 %>
<%= collection_select(:event, :location, @locations, :id, :name) %>
The problem is that in the controller, when I create a new event, it
says it expects a Location and not a string: “Location expected, got
String” in the “@event = Event.new(params[:event])” line.
I’m a bit confused…shouldn’t Rails have enough information to turn the
location ID into a full location, and actually, shouldn’t the ID be
enough in this case?