I'm sure I'm overlooking something really obvious, but I'm trying to figure out how to do a form for an object associated with the current view object.
Specifically, I have an itinerary that has events. When I'm looking at an itinerary I should be able to add new events. My relationship between the two is:
class Itinerary < ActiveRecord::Base has_many :event end
class Event < ActiveRecord::Base has_one :itinerary end
In the itineraries_controller, I have a show method defined like this:
def show @itinerary = Itinerary.find(params[:id])
@new_event = Event.new end
However, it is clearly puking on the Event.new, and I'm looking for a good place to learn about how to work through all of these associations. If this isn't the place, I'd love a link to where this is taught.
Thanks in advance.