belongs_to question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

belongs_to question

Scott Phelps
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?
_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails
Loading...