Thanks for the replies.  I assigned a random unique id to the part and
I still get an error. Could it be that I need to do something to make
the child's fields accessible in the parent's controller for the Ajax
request to work? The error now is this:

NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.+):
  hobo (1.0.0) lib/hobo/model.rb:104:in `find_by_typed_id'
  hobo (1.0.0) lib/hobo/dryml/part_context.rb:117:in `parse_this_id'
  hobo (1.0.0) lib/hobo/dryml/part_context.rb:90:in `unmarshal'
  hobo (1.0.0) lib/hobo/dryml/part_context.rb:49:in `for_refresh'
  hobo (1.0.0) lib/hobo/dryml/part_context.rb:55:in `initialize'
  hobo (1.0.0) lib/hobo/dryml/part_context.rb:48:in `new'
  hobo (1.0.0) lib/hobo/dryml/part_context.rb:48:in `for_refresh'
  hobo (1.0.0) lib/hobo/dryml/template_environment.rb:166:in
`refresh_part'
  hobo (1.0.0) lib/hobo/controller.rb:92:in `ajax_update_response'
  hobo (1.0.0) lib/hobo/controller.rb:87:in `each'
  hobo (1.0.0) lib/hobo/controller.rb:87:in `ajax_update_response'
  hobo (1.0.0) lib/hobo/model_controller.rb:818:in `render'
  hobo (1.0.0) lib/hobo/controller.rb:85:in `ajax_update_response'
  hobo (1.0.0) lib/hobo/controller.rb:73:in `hobo_ajax_response'
  app/controllers/mousemetadatas_controller.rb:10:in `new'
  hobo (1.0.0) lib/hobo/model_controller.rb:436:in `response_block'
  hobo (1.0.0) lib/hobo/model_controller.rb:432:in `response_block'
  hobo (1.0.0) lib/hobo/model_controller.rb:506:in `hobo_new'
  app/controllers/mousemetadatas_controller.rb:8:in `new'
  hobo (1.0.0) lib/hobo/controller.rb:23:in `call'
  hobo (1.0.0) lib/hobo/controller.rb:23:in `included_in_class'




On Jun 3, 2:16 pm, kevinpfromnm <[email protected]> wrote:
> you should manually assign a unique id within each part instead of
> relying on typed id (unsaved records means each id is going to be the
> same from that).
>
> On Jun 3, 11:55 am, sam <[email protected]> wrote:
>
> > Thanks Kevin for the reply.  I'm actually trying to replicate this
> > recipe but inside the 
> > input-many:http://cookbook.hobocentral.net/recipes/15-dynamically-populated-sele....
> > I assign different ID's for the parts using this other 
> > recipe:http://cookbook.hobocentral.net/recipes/8-use-parts-on-repeated-elements
> > but the problem seems to be that the typed_id on new records inside
> > <input-many> are not available.  I noticed on the standalone form it
> > produces an extra 'this' (probably because the record doesn't have an
> > ID yet?) : <div class='part-wrapper' id='foo-this:foo'>  while inside
> > the <input-many> tag this is produced: <div class='part-wrapper'
> > id='foo-:foo'>  which returns the ajax error invalid typed_id: :foo.
>
> > On Jun 3, 1:03 pm, kevinpfromnm <[email protected]> wrote:
>
> > > you can't nest forms within forms, that's why it's a field-list.
> > > getting part to work on an input-many is going to be tough as each
> > > piece is created by javascript really and doesn't have a guaranteed
> > > model associated with it.
>
> > > I'm not sure why you'd want a form to be a part though since the user
> > > will be modifying the pieces themselves and then saving...
>
> > > On Jun 3, 9:13 am, sam <[email protected]> wrote:
>
> > > > I am trying to have a part on a <do> inside a <myfield-view:> tag
> > > > which is in turn  inside an <input-many>, however I get the error
> > > > "invalid typed_id: :myfield from the parent's controller (the class
> > > > that has_many).  Any ideas how to resolve this?  It works right on a
> > > > standalone form but not inside input-many. I'm wondering if using  the
> > > > standalone child form inside the <input-many> instead of the field-
> > > > list would solve this problem, is there a way to do that?
>
> > > > thank you
>
> > > > sam
>
>

-- 
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.

Reply via email to