Hey,

I'm trying the new hobo autocompleter now for the first time, been
using model_auto_complete until now.

As far as I understood it it should work on a HMT association like
this:
models: Parent, Student, ParentStudent (join model)

student.rb declaration:

  has_many :parent_students
  has_many :parents, :through => :parent_student

Now I need to add parents to students via autocompletion (in students/
show.dryml)

Controller code:

autocomplete :parent_surname do
  student = find_instance
  hobo_completions :surname, Parent.active
end

show.dryml:

<form:parent_students.new update="parents" reset-form refocus-form>
  <div>
    <name-one:parent complete-target="&@student"
completer="parent_surname"/>
  </div>
</form>

Completion works, but I get the following exception when saving:
http://pastie.org/276692
The actual post data is: http://pastie.org/276693

I'm not sure what exactly happens here, eg. why it contains parent =>
'Max'
Apparently it's missing a 'name' field, which is not present in this
model but I'm not sure..

Can anyone enlighten me?


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