Matt, thanks for that. Actually in this particular case I do not have a man-to-many relationship for Property and PropertyType, but I appreciate your delineation of the precise usage case!
In my case I have: class ParentThing has_many :things children :things #doubt this matters, but thought I'd include it as it's in play end class Thing belongs_to :parent_thing end class ParentController auto_actions_for :thing, [:index, :new, :create] end --END SNIPPET-- So you can see that it is a reversed scenario. In this case I was hopeful to see the functionalities to add new and create, etc. for the ParentThing in the Thing's new form, however nothing renders. Is there something I'm missing or a way to force this to render? -George On Jun 26, 5:15 pm, Matt Jones <[email protected]> wrote: > On Jun 26, 2011, at 2:20 PM, ylluminate wrote: > > > Bob, curious, did you ever get this sorted? > >http://groups.google.com/group/hobousers/browse_thread/thread/35e8559... > > > It appears that that post here is slightly connected and I see other > > use cases of auto_actions_for, however each time it seems that child > > models are being manipulated rather than parents. Is this the case? > > Is my problem that you must use auto_actions_for from a controller > > that is a child model to a parent that is rendering the input form(s)? > > > If so I'm assuming that I need to rethink things here a bit. > > > Thanks again guys for any help / enlightenment on this matter. > > I'm guessing you've got a many-to-many between Property and PropertyType; the > issue, here as in Bob's case, is that auto_actions_for is somewhat > specialized for handling a simpler sort of relation. To be precise, here's > the case it's intended for: > > class ParentThing > has_many :things > end > class Thing > belongs_to :parent_thing > end > > class ThingsController > auto_actions_for :parent_thing, [:index, :new, :create] > end > > As you've both noted, trying this on either side of a has_many :through isn't > so good. > > As to your other question (regarding the selector + new form), you might want > to check out Bryan's select-one-or-new-dialog in hobo-jquery; I'm not certain > it will do what you've described, but it's certainly a step in the right > direction. > > --Matt Jones -- 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.
