Belongs_to question

Looking for some advice here:

I have a models set up like this:

class Project
end

class ContractorItem
belongs_to :project
end

class EngineerItem
belongs_to :project
end

Now, to create a new Project I have these views:

new_contractor_item
new_engineer_item

These views are set up as CSS tabs that the user can click
between and modify before clicking a “Create Project” link.

The goal is to collect all of the form data in a session and have
that form data repopulated during the Project creation until the user
clicks “Create Project” upon which the session will be reset and the
Objects will get saved to the database (after validation - of course)

Can someone show me the syntax for creating a Project Object in a
session and then subsequently add these ContractorItem and
EngineerItem Objects to that Project?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs