On Sat, Jan 2, 2010 at 4:45 AM, Ahmed Abdelsalam <[email protected]>wrote:

> Hi,
>
> I have a form for a model that have relationship to other models in my
> application. For example, a company and employees. When I add new
> employee, I should select company for which employee is working. How
> about if the employee works in a company that is not in my database? so
> I want to create that company within the same form of adding employee
> (sub form). Can anyone tell me how to do that in rails?
>
> Ahmed
>

Ahmed, it seems that you're needing a multi model form that accepts nested
attributes.  Thus,
you might want to take a look at the following example:

http://weblog.rubyonrails.org/2009/1/26/nested-model-forms

Good luck,

-Conrad


> --
> Posted via http://www.ruby-forum.com/.
>
> --
>
> 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]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
>

--

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