There can be many People in my Rails Users application, which, in turn, can belong (but not necessarily) to Organisations .
In short, this is:
Users --< People >-- Organisations
Now it would be nice to be able to create new organizations from the way people are represented in some way. He tried this:
class Person < ActiveRecord::Base attr_accessible :name, :organisation_attributes belongs_to :user belongs_to :organisation accepts_nested_attributes_for :organisation end
But it does not work, because the Organization is not a child of Person.
Is there any other way to implement this?
Thanks for any help.
source share