Let's say I have Worker, Task, and Assignment models. Worker
has_many :assignments, :dependent => :destroy and
has_many :tasks, :through => :assignments. Task
has_many :assignments, :dependent => :destroy and
has_many :workers, :through => :assignments. And finally Assignment
belongs_to :task and belongs_to :worker. But the Assignment also has
data fields, e.g. started_on, completed_on, notes, etc.
I'd like to have a Create New Assignment link at the bottom of a Task
page that brings up the form for a new assignment with the task
already populated, allowing the user to pick a Worker and fill in the
other fields. And similarly for the Worker page. I had a functioning
prototype in an earlier version of Hobo that used something like the
following in show.dryml:
<nav class="nav new-links">
<ul with="&this.assignments">
<li if="&can_create? && linkable?(:new)"><a action="new"/></li>
</ul>
</nav>
I can't quite figure out how to get this working again. Any ideas?
Also, there might be a couple of thousand objects to choose from on
each side of the association. Is an autocomplete field going to be a
workable way to pick an object, or is there a better method?
I hope the cookbook will eventually get some many-to-many recipes.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---