Hi,
Has someone addressed multi model life-cycles?
What is the best way to allow a user to create a model within the user
life-cycle?
In this case it may seem strange to place the <form for="Company"> on
the users/register_company.dryml file. It may also seem strange to
create the company on the do_register_company action on the
users_controller.
Is this the best approach?
Thanks,
TF
On 12/28/2010 09:14 AM, Tim wrote:
Hello.
Context: users are invited to be part of the system by an invitation
process; there are also companies - each company is registered by a
user when this user signup. (So, :company belongs_to :user and :user
has_one :company.)
I'm working on the User model with a life-cycle in this conditions:
States: :invited, :accepted, :active.
Create: :invite (user becomes :invited).
Transitions: :accept_invitation (:invited => :accepted)
and :register_company (:accepted => :active).
The first steps (:invite and :accept_invitation) are already working.
Now, I'm focused on the :register_company transition.
How can I work with another model (:company) inside this life-cycle?
For example, how do I put the company in the params option and make
the form of the company appear correctly in the "register_company"
action?
Like this:
transition :register_company, { :accepted => :active },
:available_to => "acting_user",
:params => [:company]
Cheers,
Tim
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" 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/hobousers?hl=en.