ok, so if parts belongs_to Revision, it must have a revision_id
which you must have created in the migration.

Assuming you have a form that sends the Parts data (in params[:parts]
and
you know to which revision it should be added, then

@revision = Revision.find(revision_id) # however you get revision id,
could eg be params[:revision_id]
@revision.parts.create(params[:parts])

would be all you need.
First line getting the revision, next line adding the part to that
revision.
revision_id is set by Rails
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to